init

Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Process

Init

rm(list = ls())
source("./helpers/helpers.R")
set.w(222)

Imports

library(ggplot2)
library(GGally)
Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2

Attaching package: 'GGally'
The following object is masked _by_ '.GlobalEnv':

    rescale01
library(plyr)
library(tidyverse)
── Attaching core tidyverse packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ lubridate 1.9.2     ✔ tibble    3.2.1
✔ purrr     1.0.2     ✔ tidyr     1.3.0
── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::arrange()   masks plyr::arrange()
✖ purrr::compact()   masks plyr::compact()
✖ dplyr::count()     masks plyr::count()
✖ dplyr::desc()      masks plyr::desc()
✖ dplyr::failwith()  masks plyr::failwith()
✖ dplyr::filter()    masks stats::filter()
✖ dplyr::id()        masks plyr::id()
✖ dplyr::lag()       masks stats::lag()
✖ dplyr::mutate()    masks plyr::mutate()
✖ dplyr::rename()    masks plyr::rename()
✖ dplyr::summarise() masks plyr::summarise()
✖ dplyr::summarize() masks plyr::summarize()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Set Directories

ifd0 <- "./data/i0002-aggregated/"
ofd0 <- "./data/i1001-data-inspection/"
dir.create(ofd0, showWarnings = FALSE, recursive = TRUE)
cat0(ifd0)
./data/i0002-aggregated/ 
cat0(ofd0)
./data/i1001-data-inspection/ 

Load Data

ifn0 <- "i0001-politicians-aggregated.rds"
suppressWarnings(rm(list = ls(pattern = "^df")))
df0 <- readr::read_rds(file.path(ifd0, ifn0))
df0 %>% dim() %>% cat0()
169997 38 

Skimr

set.w(222)
df0 %>% skimr::skim()
Data summary
Name Piped data
Number of rows 169997
Number of columns 38
_______________________
Column type frequency:
factor 5
numeric 33
________________________
Group variables None

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
Name 0 1 FALSE 870 Bar: 361, Ela: 361, Llo: 361, Pra: 361
Party 0 1 FALSE 2 Dem: 99081, Rep: 70916
Outcome 0 1 FALSE 2 win: 115031, los: 54966
Period 0 1 FALSE 3 BE: 98660, AR: 47974, MI: 23363
Phase 0 1 FALSE 4 BE: 98660, AR: 47974, AE: 12011, BR: 11352

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Days 0 1 -12.25 102.89 -180.00 -99.00 -22.00 77.00 180.00 ▇▇▇▆▆
RetweetCount 0 1 545.28 3638.96 0.00 5.00 19.00 90.00 537702.00 ▇▁▁▁▁
ReplyCount 0 1 254.44 2115.06 0.00 2.00 9.00 40.00 164721.00 ▇▁▁▁▁
LikeCount 0 1 2754.23 22665.34 0.00 18.00 70.00 363.00 3432420.00 ▇▁▁▁▁
QuoteCount 0 1 61.86 486.57 0.00 0.00 2.00 9.00 39266.00 ▇▁▁▁▁
WordCount 0 1 88.11 88.67 0.00 36.00 63.00 113.00 2872.00 ▇▁▁▁▁
Concr 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Noun 1 1 0.20 0.07 0.00 0.17 0.20 0.24 1.00 ▇▇▁▁▁
Adj 1 1 0.07 0.05 0.00 0.05 0.07 0.09 1.00 ▇▁▁▁▁
VerbWOBH 1 1 0.13 0.05 0.00 0.11 0.13 0.16 1.00 ▇▁▁▁▁
VerbBaseWOBH 1 1 0.06 0.04 0.00 0.03 0.05 0.08 1.00 ▇▁▁▁▁
AgenBig2C 1 1 0.03 0.03 0.00 0.01 0.03 0.05 0.67 ▇▁▁▁▁
AgenBig2A 1 1 0.05 0.04 0.00 0.02 0.04 0.07 0.67 ▇▁▁▁▁
CommBig2A 1 1 0.07 0.05 0.00 0.03 0.06 0.09 1.00 ▇▁▁▁▁
AgenBig2B 1 1 0.01 0.02 0.00 0.00 0.00 0.02 1.00 ▇▁▁▁▁
CommBig2B 1 1 0.02 0.03 0.00 0.00 0.02 0.03 1.00 ▇▁▁▁▁
AgencyPosit 0 1 0.54 0.23 0.00 0.39 0.53 0.67 2.37 ▆▇▁▁▁
AgencyNegat 0 1 0.04 0.09 0.00 0.00 0.00 0.04 1.69 ▇▁▁▁▁
AgencyWhole 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
AgencyAbsol 0 1 0.58 0.22 0.00 0.44 0.57 0.71 2.37 ▅▇▁▁▁
Pron 1 1 0.10 0.05 0.00 0.07 0.10 0.13 1.00 ▇▁▁▁▁
Pron1StSing 1 1 0.02 0.03 0.00 0.00 0.01 0.03 0.50 ▇▁▁▁▁
Anger 0 1 0.11 0.16 0.00 0.02 0.05 0.15 0.99 ▇▁▁▁▁
Disgust 0 1 0.02 0.06 0.00 0.00 0.00 0.01 0.99 ▇▁▁▁▁
Fear 0 1 0.30 0.28 0.00 0.04 0.23 0.48 1.00 ▇▃▃▂▂
Joy 0 1 0.24 0.27 0.00 0.02 0.12 0.37 0.99 ▇▂▂▁▁
Neutral 0 1 0.19 0.22 0.00 0.02 0.10 0.30 0.97 ▇▂▁▁▁
Sadness 0 1 0.08 0.16 0.00 0.01 0.02 0.08 0.99 ▇▁▁▁▁
Surprise 0 1 0.06 0.09 0.00 0.01 0.03 0.07 0.98 ▇▁▁▁▁
Concreteness 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Agency 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
Readability 0 1 0.65 0.17 -3.24 0.55 0.65 0.75 1.77 ▁▁▁▇▂
Time 0 1 -0.07 0.57 -1.00 -0.55 -0.12 0.43 1.00 ▇▇▇▆▆

Get Smooth Data for Plot (loess: Local Polynomial Regression Fitting)

span <- 36 / 360
fitAgencySm1 <- loess(Agency ~ Days, degree = 1, span = span, data = df0)
for (var0 in names(fitAgencySm1)) {cat0(var0)}
n 
fitted 
residuals 
enp 
s 
one.delta 
two.delta 
trace.hat 
divisor 
robust 
pars 
kd 
call 
terms 
xnames 
x 
y 
weights 

Prepare for Smooth Plot

colors8 <-
  c(
    "green", "magenta",
    rep("blue", times = 3),
    rep("red", times = 3),
    rep("blue", times = 2),
    rep("red", times = 2)
  )

colors2 <-
  c(
    "green", "magenta",
    hcl(h = seq(from = 30, to = 360, length = 25)[-25], c = 100, l = 65)
  )

colors0 <- colors8
colors0 <- colors2
colors0
 [1] "green"   "magenta" "#ED813E" "#E08B00" "#D09400" "#BD9D00" "#A6A400" "#8BAB00" "#66B200" "#1FB700" "#00BB4B" "#00BE71" "#00C090" "#00C1AC" "#00BFC4" "#00BBDA" "#00B5ED" "#00ACFB" "#3FA1FF" "#8993FF" "#B584FF"
[22] "#D476FE" "#EA6AF1" "#F862DE" "#FF61C8" "#FF65AE"

Smooth Plot

suppressWarnings(rm(list = ls(pattern = "^gg0")))
gg01 <- df0 %>%
  dplyr::mutate(AgencySm1 = fitAgencySm1$fitted) %>%
  dplyr::arrange(Phase, Period) %>%
  dplyr::mutate(
    int0 = interaction(Period, Outcome),
    int2 = interaction(Phase, Outcome),
    ## int0 = interaction(Period, Party),
    ## int2 = interaction(Phase, Party),
    ## int0 = interaction(Period, Outcome, Party),
    ## int2 = interaction(Phase, Outcome, Party),
  ) %>%
  ggplot(aes(x = Days, y = Agency)) +
  geom_point(alpha = 0.05, aes(x = Days, y = Agency, color = Outcome, fill = Outcome)) +
  geom_line(aes(Days, AgencySm1), color = "black", lwd = 0.5) +
  geom_smooth(formula = y ~ x, color = "black", se = TRUE) +
  geom_smooth(aes(color = int0, fill = int0), formula = y ~ x, se = TRUE) +
  geom_smooth(aes(color = int2, fill = int2), formula = y ~ x, se = TRUE, data = . %>% filter(Days > 0 & Days <= 63)) +
  ## geom_smooth(aes(color=int3, fill=int3), formula=y~x, se=TRUE) +
  geom_vline(xintercept = 0, linetype = "dashed", color = "blue", lwd = 1) +
  geom_vline(xintercept = 32, linetype = "dashed", color = "black", lwd = 0.75) +
  geom_vline(xintercept = 63, linetype = "dashed", color = "red", lwd = 1) +
  scale_color_manual(values = colors0) +
  scale_fill_manual(values = colors0) +
  guides(color = guide_legend(override.aes = list(alpha = 1))) +
  coord_cartesian(ylim = c(0.33, 0.66)) +
  NULL

file <- file.path(ofd0, "i0001-timeseries.png")
suppressWarnings(ggsave(file = file, plot = gg01, w = 10, h = 8))
`geom_smooth()` using method = 'gam'
`geom_smooth()` using method = 'gam'
`geom_smooth()` using method = 'gam'
suppressWarnings(gg01)
`geom_smooth()` using method = 'gam'
`geom_smooth()` using method = 'gam'
`geom_smooth()` using method = 'gam'

cat0(file)
./data/i1001-data-inspection//i0001-timeseries.png 

Comment

  • Please note that the above plot contains two separate sets of OLS fits by both Outcome x Period (the latter has 3 levels), as well as, Outcome x Phase (the latter has 4 levels) In my humble opinion the riot was a type of unexpected (not-surprising) event, it is different from an unexpected event like a terrorist operation that typically is completely hidden from general public before it is executed (revealed instantly). The riot was brewing days before it happened, there were speculations about some form of manifestation and preparations were in place and in plain sight for everyone to see. Furthermore, politicans on both sides, as well as other actors, were trying to influence this movement. What can be viewed as surprising is the specific form that the manifestation took place.
  • This is why I would preffer to use Phase instead of Period. It should entail a more realistic description of these events, with only few extra post-hoc comparisons to be made.

Functions for correlation plots

ggpairs_lower_fun <- function(data, mapping, emap = NULL, method = "lm", n = 1000, alpha = 0.2, ...) {
  mapping <- ggplot2:::new_aes(c(mapping, emap))
  data <- dplyr::slice_sample(data, n = n)
  p <- ggplot(data = data, mapping = mapping) +
    geom_point(alpha = alpha, ...) +
    geom_smooth(method = method, ...) +
    theme_classic() # to get the white background and prominent axis
  p
}

Correlations on raw data

options(warn=-1)
suppressWarnings(rm(list = ls(pattern = "^gg02")))
gg02 <- df0 %>%
  dplyr::select(
           Outcome,
           Anger, Disgust, Fear, Joy, Neutral, Sadness, Surprise,
           Concreteness, Agency, Readability,
           ) %>%
  ## dplyr::slice_sample(n = 20000) %>%
  identity() %>%
  GGally::ggpairs(
            progress = FALSE,
            title = "Pairwise correlations",
            mapping = ggplot2::aes(color = Outcome, fill = Outcome),
            diag = list(
              continuous = GGally::wrap(
                                     "densityDiag",
                                     bins = 30,
                                     alpha = 0.3)),
            lower = list(
              continuous = GGally::wrap(
                                     ggpairs_lower_fun,
                                     method = "lm",
                                     formula = y ~ x,
                                     fullrange = TRUE,
                                     se = TRUE,
                                     n = 3000,
                                     alpha = 0.1
                                   )),
)

file <- file.path(ofd0, "i0002-correlations-raw.png")
suppressWarnings(ggsave(file = file, plot = gg02, w = 16, h = 8))
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
suppressWarnings(gg02)
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

cat0(file)
./data/i1001-data-inspection//i0002-correlations-raw.png 
options(warn=0)

Comment

CAUTION: It seems that we have an overwhelming zero-inflated distribution for each of the emotion-related variables.

Correlations on log-emotions and raw data

options(warn=-1)
suppressWarnings(rm(list = ls(pattern = "^gg03")))
gg03 <- df0 %>%
  dplyr::select(
           Outcome,
           Anger, Disgust, Fear, Joy, Neutral, Sadness, Surprise,
           Concreteness, Agency, Readability,
           ) %>%
  dplyr::mutate(across(-c(Outcome, Agency, Concreteness, Readability), ~ log(.x + 5e-3))) %>%
  ## dplyr::slice_sample(n = 20000) %>%
  identity() %>%
  GGally::ggpairs(
            progress = FALSE,
            title = "Pairwise correlations",
            mapping = ggplot2::aes(color = Outcome, fill = Outcome),
            diag = list(
              continuous = GGally::wrap(
                                     "densityDiag",
                                     bins = 30,
                                     alpha = 0.3)),
            lower = list(
              continuous = GGally::wrap(
                                     ggpairs_lower_fun,
                                     method = "lm",
                                     formula = y ~ x,
                                     fullrange = TRUE,
                                     se = TRUE,
                                     n = 3000,
                                     alpha = 0.1
                                   )),
)

file <- file.path(ofd0, "i0003-correlations-log.png")
suppressWarnings(ggsave(file = file, plot = gg03, w = 16, h = 8))
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
suppressWarnings(gg03)
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

cat0(file)
./data/i1001-data-inspection//i0003-correlations-log.png 
options(warn=0)

Comment

  • The log-transformed emotions look a bit better, however, there are two more approaches that I haven not managed to fully explore. One is making the emotions a categorical variable with two levels (TRUE, FALSE). This would be problematic, however as we already work on data aggregated by Name, Party, Outcome, Days, thus FALSE/zero would mean that specific emotion was not present in data from a particular Name on particular Day. This seems strange to me, but I am open to be convinced otherwise. The second option may be provided by the bestNormalize library (see: https://cran.r-project.org/web/packages/bestNormalize/vignettes/bestNormalize.html).
  • For now 0.001 seems to be a good trade-off between all emotions.
  • For, example, the effect of shift in log on Disgust (the mode skewed emotion):
suppressWarnings(rm(list = ls(pattern = "^gg04")))
gg04 <- df0 %>%
  dplyr::select(Disgust) %>%
  dplyr::mutate(
    Disgust1e4 = log(Disgust + 1e-4),
    Disgust1e3 = log(Disgust + 1e-3),
    Disgust1e2 = log(Disgust + 1e-2),
  ) %>%
  tidyr::pivot_longer(cols = starts_with("Disgust"), names_to = "Var", values_to = "Value") %>%
  identity() %>%
  ggplot(aes(x = Value, color = Var, fill = Var)) +
  geom_histogram(binwidth = 0.125, alpha = 0.5) +
  theme_minimal()

file <- file.path(ofd0, "i0004-log-transform.png")
suppressWarnings(ggsave(file = file, plot = gg04, w = 6, h = 4))
suppressWarnings(gg04)

Log-Transform

df0 <- df0 %>%
  dplyr::mutate(
    LogAnger = log(Anger + 1e-3),
    LogDisgust = log(Disgust + 1e-3),
    LogFear = log(Fear + 1e-3),
    LogJoy = log(Joy + 1e-3),
    LogNeutral = log(Neutral + 1e-3),
    LogSadness = log(Sadness + 1e-3),
    LogSurprise = log(Surprise + 1e-3),
  ) %>%
  identity()

Skim

set.w(222)
df0 %>% skimr::skim()
Data summary
Name Piped data
Number of rows 169997
Number of columns 45
_______________________
Column type frequency:
factor 5
numeric 40
________________________
Group variables None

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
Name 0 1 FALSE 870 Bar: 361, Ela: 361, Llo: 361, Pra: 361
Party 0 1 FALSE 2 Dem: 99081, Rep: 70916
Outcome 0 1 FALSE 2 win: 115031, los: 54966
Period 0 1 FALSE 3 BE: 98660, AR: 47974, MI: 23363
Phase 0 1 FALSE 4 BE: 98660, AR: 47974, AE: 12011, BR: 11352

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Days 0 1 -12.25 102.89 -180.00 -99.00 -22.00 77.00 180.00 ▇▇▇▆▆
RetweetCount 0 1 545.28 3638.96 0.00 5.00 19.00 90.00 537702.00 ▇▁▁▁▁
ReplyCount 0 1 254.44 2115.06 0.00 2.00 9.00 40.00 164721.00 ▇▁▁▁▁
LikeCount 0 1 2754.23 22665.34 0.00 18.00 70.00 363.00 3432420.00 ▇▁▁▁▁
QuoteCount 0 1 61.86 486.57 0.00 0.00 2.00 9.00 39266.00 ▇▁▁▁▁
WordCount 0 1 88.11 88.67 0.00 36.00 63.00 113.00 2872.00 ▇▁▁▁▁
Concr 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Noun 1 1 0.20 0.07 0.00 0.17 0.20 0.24 1.00 ▇▇▁▁▁
Adj 1 1 0.07 0.05 0.00 0.05 0.07 0.09 1.00 ▇▁▁▁▁
VerbWOBH 1 1 0.13 0.05 0.00 0.11 0.13 0.16 1.00 ▇▁▁▁▁
VerbBaseWOBH 1 1 0.06 0.04 0.00 0.03 0.05 0.08 1.00 ▇▁▁▁▁
AgenBig2C 1 1 0.03 0.03 0.00 0.01 0.03 0.05 0.67 ▇▁▁▁▁
AgenBig2A 1 1 0.05 0.04 0.00 0.02 0.04 0.07 0.67 ▇▁▁▁▁
CommBig2A 1 1 0.07 0.05 0.00 0.03 0.06 0.09 1.00 ▇▁▁▁▁
AgenBig2B 1 1 0.01 0.02 0.00 0.00 0.00 0.02 1.00 ▇▁▁▁▁
CommBig2B 1 1 0.02 0.03 0.00 0.00 0.02 0.03 1.00 ▇▁▁▁▁
AgencyPosit 0 1 0.54 0.23 0.00 0.39 0.53 0.67 2.37 ▆▇▁▁▁
AgencyNegat 0 1 0.04 0.09 0.00 0.00 0.00 0.04 1.69 ▇▁▁▁▁
AgencyWhole 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
AgencyAbsol 0 1 0.58 0.22 0.00 0.44 0.57 0.71 2.37 ▅▇▁▁▁
Pron 1 1 0.10 0.05 0.00 0.07 0.10 0.13 1.00 ▇▁▁▁▁
Pron1StSing 1 1 0.02 0.03 0.00 0.00 0.01 0.03 0.50 ▇▁▁▁▁
Anger 0 1 0.11 0.16 0.00 0.02 0.05 0.15 0.99 ▇▁▁▁▁
Disgust 0 1 0.02 0.06 0.00 0.00 0.00 0.01 0.99 ▇▁▁▁▁
Fear 0 1 0.30 0.28 0.00 0.04 0.23 0.48 1.00 ▇▃▃▂▂
Joy 0 1 0.24 0.27 0.00 0.02 0.12 0.37 0.99 ▇▂▂▁▁
Neutral 0 1 0.19 0.22 0.00 0.02 0.10 0.30 0.97 ▇▂▁▁▁
Sadness 0 1 0.08 0.16 0.00 0.01 0.02 0.08 0.99 ▇▁▁▁▁
Surprise 0 1 0.06 0.09 0.00 0.01 0.03 0.07 0.98 ▇▁▁▁▁
Concreteness 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Agency 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
Readability 0 1 0.65 0.17 -3.24 0.55 0.65 0.75 1.77 ▁▁▁▇▂
Time 0 1 -0.07 0.57 -1.00 -0.55 -0.12 0.43 1.00 ▇▇▇▆▆
LogAnger 0 1 -3.04 1.42 -6.57 -4.11 -3.05 -1.89 0.00 ▂▆▇▇▃
LogDisgust 0 1 -5.37 1.33 -6.81 -6.28 -5.90 -4.88 -0.01 ▇▂▁▁▁
LogFear 0 1 -2.09 1.73 -6.72 -3.27 -1.45 -0.74 0.00 ▁▂▂▃▇
LogJoy 0 1 -2.49 1.76 -6.70 -3.95 -2.09 -0.99 -0.01 ▂▃▃▆▇
LogNeutral 0 1 -2.60 1.65 -6.73 -3.93 -2.26 -1.19 -0.03 ▂▅▅▇▇
LogSadness 0 1 -3.48 1.35 -6.45 -4.49 -3.75 -2.58 -0.01 ▂▇▆▃▂
LogSurprise 0 1 -3.48 1.23 -6.71 -4.33 -3.38 -2.60 -0.02 ▂▅▇▅▁

Check factors order

cat0(sep0)
===================================================================== 
df0 %>%
  dplyr::select(Phase) %>%
  summary()
 Phase     
 BE:98660  
 AE:12011  
 BR:11352  
 AR:47974  
cat0(sep0)
===================================================================== 
df0 %>%
  dplyr::select(Period) %>%
  summary()
 Period    
 MI:23363  
 BE:98660  
 AR:47974  
cat0(sep0)
===================================================================== 

Setup for Regression by Period

ofd2 <- "./data/i4001-model-by-period"
dir.create(ofd2, showWarnings = FALSE, recursive = TRUE)
dir8 <- file.path(ofd2, "i0001_models")
dir.create(dir8, showWarnings = FALSE)
model <- "fit0x0"
fbase <- file.path(dir8, model)
fpath <- paste0(fbase, ".extension")
fpath %>% cat0()
./data/i4001-model-by-period/i0001_models/fit0x0.extension 
suppressWarnings(rm(list = ls(pattern = "(^fit)|(^model.*)|(^Model.*)")))
REML <- TRUE
control <- lme4::lmerControl(optimizer = "Nelder_Mead")
for (var0 in ls(pattern = "(^df.*)|(^data.*)")) {
  cat0(var0)
}
df0 
for (var0 in ls(pattern = "(^fit.*)|(^m.*)")) {
  cat0(var0)
}

Model 00: Null

Fit

model <- "fit00aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (1 | Name) + 1,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit00aPd: [df0] Agency ~ (1 | Name) + 1
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (1 | Name) + 1
   Data: df0
Control: control

REML criterion at convergence: 26631.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-7.9514 -0.5639 -0.0023  0.5683  7.3986 

Random effects:
 Groups   Name        Variance Std.Dev.
 Name     (Intercept) 0.006209 0.0788  
 Residual             0.067519 0.2598  
Number of obs: 169997, groups:  Name, 870

Fixed effects:
             Estimate Std. Error        df t value Pr(>|t|)    
(Intercept) 4.986e-01  2.807e-03 8.264e+02   177.7   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit00aPd: [df0] Agency ~ (1 | Name) + 1
# R2 for Mixed Models

  Conditional R2: 0.084
     Marginal R2: 0.000
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit00aPd: [df0] Agency ~ (1 | Name) + 1
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.084
  Unadjusted ICC: 0.084
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit00aPd: [df0] Agency ~ (1 | Name) + 1
# ICC by Group

Group |   ICC
-------------
Name  | 0.084

Model 01: Null

Fit

model <- "fit01aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + 1,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit01aPd: [df0] Agency ~ (Time | Name) + 1
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + 1
   Data: df0
Control: control

REML criterion at convergence: 24946.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.0343 -0.5639 -0.0046  0.5665  7.3418 

Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Name     (Intercept) 0.006283 0.07927      
          Time        0.004189 0.06472  0.18
 Residual             0.066384 0.25765      
Number of obs: 169997, groups:  Name, 870

Fixed effects:
             Estimate Std. Error        df t value Pr(>|t|)    
(Intercept) 5.001e-01  2.796e-03 8.209e+02   178.9   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit01aPd: [df0] Agency ~ (Time | Name) + 1
Warning: Random slopes not present as fixed effects. This artificially inflates the conditional random effect variances.
  Solution: Respecify fixed structure!
# R2 for Mixed Models

  Conditional R2: 0.086
     Marginal R2: 0.000
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit01aPd: [df0] Agency ~ (Time | Name) + 1
Warning: Random slopes not present as fixed effects. This artificially inflates the conditional random effect variances.
  Solution: Respecify fixed structure!
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.086
  Unadjusted ICC: 0.086
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit01aPd: [df0] Agency ~ (Time | Name) + 1
Warning: Random slopes not present as fixed effects. This artificially inflates the conditional random effect variances.
  Solution: Respecify fixed structure!
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.086

Model 02: Time

Fit

model <- "fit02aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit02aPd: [df0] Agency ~ (Time | Name) + Time
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time
   Data: df0
Control: control

REML criterion at convergence: 24941.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.0353 -0.5639 -0.0047  0.5664  7.3362 

Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Name     (Intercept) 0.006283 0.07927      
          Time        0.004088 0.06394  0.18
 Residual             0.066384 0.25765      
Number of obs: 169997, groups:  Name, 870

Fixed effects:
              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)   0.498029   0.002848 816.443563 174.884  < 2e-16 ***
Time         -0.010230   0.002634 709.116999  -3.884 0.000112 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
     (Intr)
Time 0.187 
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit02aPd: [df0] Agency ~ (Time | Name) + Time
# R2 for Mixed Models

  Conditional R2: 0.102
     Marginal R2: 0.000
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit02aPd: [df0] Agency ~ (Time | Name) + Time
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.102
  Unadjusted ICC: 0.102
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit02aPd: [df0] Agency ~ (Time | Name) + Time
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.085

Model Summary

pp(model);
fit02aPd: [df0] Agency ~ (Time | Name) + Time
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.01 -0.02, -0.01 <0.001
Name.sd__(Intercept) 0.08

Name.cor__(Intercept).Time 0.18

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit02aPd: [df0] Agency ~ (Time | Name) + Time
parameters::model_parameters(get(model))
# Fixed Effects

Parameter   | Coefficient |       SE |         95% CI | t(169991) |      p
--------------------------------------------------------------------------
(Intercept) |        0.50 | 2.85e-03 | [ 0.49,  0.50] |    174.88 | < .001
Time        |       -0.01 | 2.63e-03 | [-0.02, -0.01] |     -3.88 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.08
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |        0.18
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

Plot Model: Fixed Effects: Time

terms <- c("Time")
extra <- "0001"

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(
  get(model), terms=terms, type="eff", show.data=TRUE) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  NULL
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-fixed-effects-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

Plot Model: Random Effects

extra <- "0002"

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(get(model), type="re")
file = file.path(dir8, paste0(model,"-xtr-",extra,"-random-effects-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

Plot Model: Estimates

extra <- "0003"

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(get(model), type="est")
file = file.path(dir8, paste0(model,"-xtr-",extra,"-estimates-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

GGEffects: Time: NULL

extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.15,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(0.45, 0.55))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

pp(model);
fit02aPd: [df0] Agency ~ (Time | Name) + Time
cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.51 | 0.50, 0.52
-0.50 |      0.50 | 0.50, 0.51
 0.00 |      0.50 | 0.49, 0.50
 0.50 |      0.49 | 0.49, 0.50
 1.00 |      0.49 | 0.48, 0.50

Adjusted for:
* Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope     |       95% CI |     p
--------------------------------
-7.57e-03 | -0.01,  0.00 | 0.004
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 03: Time x Period

Fit

model <- "fit03aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period
   Data: df0
Control: control

REML criterion at convergence: 24351.7

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.1105 -0.5636 -0.0071  0.5640  7.3716 

Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Name     (Intercept) 0.006226 0.07891      
          Time        0.004116 0.06415  0.18
 Residual             0.066142 0.25718      
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)    5.060e-01  4.329e-03  4.392e+03 116.881  < 2e-16 ***
Time          -1.488e-01  1.667e-02  1.511e+05  -8.922  < 2e-16 ***
PeriodBE       2.261e-02  3.709e-03  1.692e+05   6.098 1.08e-09 ***
PeriodAR       2.205e-02  5.557e-03  1.693e+05   3.968 7.25e-05 ***
Time:PeriodBE  1.933e-01  1.675e-02  1.691e+05  11.540  < 2e-16 ***
Time:PeriodAR  8.306e-02  1.767e-02  1.689e+05   4.700 2.60e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Tm:PBE
Time        -0.635                            
PeriodBE    -0.699  0.759                     
PeriodAR    -0.461  0.512  0.536              
Time:PerdBE  0.647 -0.976 -0.692 -0.509       
Time:PerdAR  0.616 -0.923 -0.718 -0.759  0.918
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
# R2 for Mixed Models

  Conditional R2: 0.105
     Marginal R2: 0.004
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.101
  Unadjusted ICC: 0.101
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.085

Model Summary

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.15 -0.18, -0.12 <0.001
Period


    BE - MI 0.01 0.00, 0.02 0.10
    AR - MI 0.02 0.00, 0.03 0.032
    AR - BE 0.01 0.00, 0.02 0.4
Time * Period


    Time * BE 0.19 0.16, 0.23 <0.001
    Time * AR 0.08 0.05, 0.12 <0.001
Name.sd__(Intercept) 0.08

Name.cor__(Intercept).Time 0.18

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
parameters::model_parameters(get(model))
# Fixed Effects

Parameter          | Coefficient |       SE |         95% CI | t(169987) |      p
---------------------------------------------------------------------------------
(Intercept)        |        0.51 | 4.33e-03 | [ 0.50,  0.51] |    116.88 | < .001
Time               |       -0.15 |     0.02 | [-0.18, -0.12] |     -8.92 | < .001
Period [BE]        |        0.02 | 3.71e-03 | [ 0.02,  0.03] |      6.10 | < .001
Period [AR]        |        0.02 | 5.56e-03 | [ 0.01,  0.03] |      3.97 | < .001
Time × Period [BE] |        0.19 |     0.02 | [ 0.16,  0.23] |     11.54 | < .001
Time × Period [AR] |        0.08 |     0.02 | [ 0.05,  0.12] |      4.70 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.08
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |        0.18
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

Plot Model: Fixed Effects: Time

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "0001"
terms=c("Time")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(
  get(model), terms=terms, type="eff", show.data=TRUE) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  NULL
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-fixed-effects-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

Plot Model: Random Effects

pp(model)
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "0002"

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(get(model), type="re")
file = file.path(dir8, paste0(model,"-xtr-",extra,"-random-effects-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

Plot Model: Estimates

pp(model)
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "0003"

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_model(get(model), type="est")
file = file.path(dir8, paste0(model,"-xtr-",extra,"-estimates-", paste(terms, collapse="-x-"),".png"))
ggsave(file=file, plot=gg88, width=8, height=6)
gg88

GGEffects: Time: NULL

pp(model)
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(0.25, 0.75))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.62, 0.69
-0.50 |      0.58 | 0.56, 0.60
 0.00 |      0.51 | 0.50, 0.51
 0.50 |      0.43 | 0.42, 0.44
 1.00 |      0.36 | 0.33, 0.39

Adjusted for:
* Period = MI
*   Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope     |       95% CI |     p
--------------------------------
-9.10e-03 | -0.02,  0.00 | 0.025
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: NULL

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "1002"
terms <- c("Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period | Predicted |     95% CI
-------------------------------
MI     |      0.52 | 0.51, 0.53
BE     |      0.53 | 0.52, 0.53
AR     |      0.53 | 0.52, 0.54

Adjusted for:
* Time = -0.07
* Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Predicted |     95% CI |      p
----------------------------------------
BE     |      0.53 | 0.52, 0.53 | < .001
MI     |      0.52 | 0.51, 0.53 | < .001
AR     |      0.53 | 0.52, 0.54 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: DIFF

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period |  Contrast |       95% CI |     p
-----------------------------------------
BE-MI  |  9.46e-03 |  0.00,  0.02 | 0.058
BE-AR  | -6.94e-03 | -0.02,  0.00 | 0.173
MI-AR  |     -0.02 | -0.03,  0.00 | 0.036
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: NULL

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
extra <- "1003"
terms <- c("Time", "Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.62, 0.69
-0.50 |      0.58 | 0.56, 0.60
 0.00 |      0.51 | 0.50, 0.51
 0.50 |      0.43 | 0.42, 0.44
 1.00 |      0.36 | 0.33, 0.39

Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.48 | 0.48, 0.49
-0.50 |      0.51 | 0.50, 0.51
 0.00 |      0.53 | 0.52, 0.53
 0.50 |      0.55 | 0.54, 0.56
 1.00 |      0.57 | 0.56, 0.58

Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.59 | 0.57, 0.62
-0.50 |      0.56 | 0.55, 0.58
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.50 | 0.49, 0.50
 1.00 |      0.46 | 0.45, 0.47

Adjusted for:
* Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Slope |       95% CI |      p
--------------------------------------
MI     | -0.15 | -0.18, -0.12 | < .001
BE     |  0.04 |  0.04,  0.05 | < .001
AR     | -0.07 | -0.08, -0.05 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: DIFF

pp(model);
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period | Contrast |       95% CI |      p
-----------------------------------------
MI-BE  |    -0.19 | -0.23, -0.16 | < .001
MI-AR  |    -0.08 | -0.12, -0.05 | < .001
BE-AR  |     0.11 |  0.10,  0.12 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 04: Time x Period x Outcome

Fit

model <- "fit04aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome
   Data: df0
Control: control

REML criterion at convergence: 23854.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.1837 -0.5638 -0.0081  0.5631  7.3819 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004807 0.06934       
          Time        0.003341 0.05780  -0.07
 Residual             0.066045 0.25699       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  4.567e-01  7.401e-03  1.061e+04  61.707  < 2e-16 ***
Time                        -2.702e-01  3.234e-02  1.606e+05  -8.355  < 2e-16 ***
PeriodBE                     5.844e-02  6.870e-03  1.693e+05   8.506  < 2e-16 ***
PeriodAR                    -4.617e-02  1.140e-02  1.686e+05  -4.049 5.15e-05 ***
Outcomewinner                7.767e-02  8.954e-03  7.523e+03   8.674  < 2e-16 ***
Time:PeriodBE                3.272e-01  3.250e-02  1.690e+05  10.068  < 2e-16 ***
Time:PeriodAR                2.506e-01  3.494e-02  1.692e+05   7.171 7.46e-13 ***
Time:Outcomewinner           1.571e-01  3.771e-02  1.588e+05   4.165 3.12e-05 ***
PeriodBE:Outcomewinner      -5.373e-02  8.169e-03  1.694e+05  -6.577 4.83e-11 ***
PeriodAR:Outcomewinner       8.680e-02  1.306e-02  1.692e+05   6.645 3.03e-11 ***
Time:PeriodBE:Outcomewinner -1.775e-01  3.793e-02  1.692e+05  -4.679 2.89e-06 ***
Time:PeriodAR:Outcomewinner -2.136e-01  4.052e-02  1.693e+05  -5.272 1.35e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.715                                                                      
PeriodBE    -0.808  0.769                                                               
PeriodAR    -0.478  0.471  0.514                                                        
Outcomewnnr -0.827  0.591  0.668  0.395                                                 
Time:PerdBE  0.709 -0.985 -0.722 -0.469 -0.586                                          
Time:PerdAR  0.662 -0.912 -0.713 -0.750 -0.547  0.907                                   
Tm:Otcmwnnr  0.613 -0.858 -0.659 -0.404 -0.701  0.845  0.782                            
PrdBE:Otcmw  0.679 -0.646 -0.841 -0.432 -0.770  0.607  0.600  0.765                     
PrdAR:Otcmw  0.417 -0.411 -0.448 -0.873 -0.475  0.410  0.655  0.485  0.519              
Tm:PrdBE:Ot -0.608  0.844  0.619  0.402  0.693 -0.857 -0.778 -0.982 -0.708 -0.482       
Tm:PrdAR:Ot -0.571  0.786  0.615  0.647  0.651 -0.783 -0.863 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
# R2 for Mixed Models

  Conditional R2: 0.100
     Marginal R2: 0.019
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.083
  Unadjusted ICC: 0.081
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.067

Model Summary

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.33, -0.21 <0.001
Period


    BE - MI 0.02 0.00, 0.03 0.007
    AR - MI -0.01 -0.03, 0.01 0.2
    AR - BE -0.03 -0.04, -0.01 <0.001
Outcome


    winner - loser 0.09 0.07, 0.10 <0.001
Time * Period


    Time * BE 0.33 0.26, 0.39 <0.001
    Time * AR 0.25 0.18, 0.32 <0.001
Time * Outcome


    Time * winner 0.16 0.08, 0.23 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.18 -0.25, -0.10 <0.001
    Time * AR * winner -0.21 -0.29, -0.13 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.07

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
parameters::model_parameters(get(model))
# Fixed Effects

Parameter                               | Coefficient |       SE |         95% CI | t(169981) |      p
------------------------------------------------------------------------------------------------------
(Intercept)                             |        0.46 | 7.40e-03 | [ 0.44,  0.47] |     61.71 | < .001
Time                                    |       -0.27 |     0.03 | [-0.33, -0.21] |     -8.35 | < .001
Period [BE]                             |        0.06 | 6.87e-03 | [ 0.04,  0.07] |      8.51 | < .001
Period [AR]                             |       -0.05 |     0.01 | [-0.07, -0.02] |     -4.05 | < .001
Outcome [winner]                        |        0.08 | 8.95e-03 | [ 0.06,  0.10] |      8.67 | < .001
Time × Period [BE]                      |        0.33 |     0.03 | [ 0.26,  0.39] |     10.07 | < .001
Time × Period [AR]                      |        0.25 |     0.03 | [ 0.18,  0.32] |      7.17 | < .001
Time × Outcome [winner]                 |        0.16 |     0.04 | [ 0.08,  0.23] |      4.16 | < .001
Period [BE] × Outcome [winner]          |       -0.05 | 8.17e-03 | [-0.07, -0.04] |     -6.58 | < .001
Period [AR] × Outcome [winner]          |        0.09 |     0.01 | [ 0.06,  0.11] |      6.65 | < .001
(Time × Period [BE]) × Outcome [winner] |       -0.18 |     0.04 | [-0.25, -0.10] |     -4.68 | < .001
(Time × Period [AR]) × Outcome [winner] |       -0.21 |     0.04 | [-0.29, -0.13] |     -5.27 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.07
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |       -0.07
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

GGEffects: Time: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(-0.25, 1.25))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.73 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.64
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.13, 0.24

Adjusted for:
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope |       95% CI |     p
----------------------------
-0.01 | -0.02,  0.00 | 0.005
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1002"
terms <- c("Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.46, 0.49
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.39, 0.43

Adjusted for:
*    Time = -0.07
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Predicted |     95% CI |      p
----------------------------------------
BE     |      0.51 | 0.50, 0.52 | < .001
MI     |      0.48 | 0.46, 0.49 | < .001
AR     |      0.41 | 0.39, 0.43 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Plot low-level (reorder x-axis)

CAUTION: AFTER REORDER ALWAYS CHECK IF THE MANUAL LABEL ALTERANTIONS MATCH THE ABOVE “AUTOMATIC” PLOT!

## CAUTION AFTER REORDER ALWAYS CHECK 
## IF THE MANUAL LABEL ALTERANTIONS MATCH 
## THE ABOVE "AUTOMATIC" PLOT!

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1002"
terms <- c("Period")

type <- "eff"
type <- "pred"

suppressWarnings(rm(list = ls(pattern = "^gg44")))
gg44 <- sjPlot::plot_model(
  get(model), 
  type = type, 
  terms = terms, 
  ## order.terms=c("BE","MI","AR"),  ## This does not work as expected :/
  )

## str(gg44$data)
gg44$data$x <- c(2,1,3)
## gg44 <- gg44 + scale_x_discrete(labels = c("BE", "MI", "ARRR"))
gg44 <- gg44 + scale_x_continuous(
  breaks=c(1,2,3),
  labels=c("_BE", "_MI", "_AR"))
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-sjplot-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg44, width=8, height=6)
gg44

GGEffects: Period: DIFF

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period | Contrast |     95% CI |      p
---------------------------------------
BE-MI  |     0.04 | 0.02, 0.05 | < .001
BE-AR  |     0.10 | 0.08, 0.12 | < .001
MI-AR  |     0.06 | 0.04, 0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1003"
terms <- c("Time", "Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.73 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.64
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.13, 0.24

Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.50
 0.00 |      0.52 | 0.51, 0.52
 0.50 |      0.54 | 0.53, 0.56
 1.00 |      0.57 | 0.56, 0.59

Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.43 | 0.38, 0.48
-0.50 |      0.42 | 0.39, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Adjusted for:
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Slope |       95% CI |      p
--------------------------------------
MI     | -0.27 | -0.33, -0.21 | < .001
BE     |  0.06 |  0.05,  0.07 | < .001
AR     | -0.02 | -0.05,  0.01 | 0.173 
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Test low-level

## str(gg88$data)

GGEffects: Time x Period: DIFF

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period | Contrast |       95% CI |      p
-----------------------------------------
MI-BE  |    -0.33 | -0.39, -0.26 | < .001
MI-AR  |    -0.25 | -0.32, -0.18 | < .001
BE-AR  |     0.08 |  0.05,  0.11 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1004"
terms <- c("Time", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.73 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.64
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.13, 0.24

Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.56, 0.62
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.48 | 0.46, 0.49
 1.00 |      0.42 | 0.39, 0.45

Adjusted for:
* Period = MI
*   Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Outcome | Slope |       95% CI |      p
---------------------------------------
loser   | -0.27 | -0.33, -0.21 | < .001
winner  | -0.11 | -0.15, -0.08 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: DIFF

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Outcome      | Contrast |       95% CI |      p
-----------------------------------------------
loser-winner |    -0.16 | -0.23, -0.08 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1005"
terms <- c("Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.46, 0.49
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.39, 0.43

Outcome: winner

Period | Predicted |     95% CI
-------------------------------
MI     |      0.54 | 0.53, 0.55
BE     |      0.54 | 0.53, 0.54
AR     |      0.58 | 0.57, 0.59

Adjusted for:
* Time = -0.07
* Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Outcome | Predicted |     95% CI |      p
--------------------------------------------------
MI     |   loser |      0.48 | 0.46, 0.49 | < .001
BE     |   loser |      0.51 | 0.50, 0.52 | < .001
AR     |   loser |      0.41 | 0.39, 0.43 | < .001
MI     |  winner |      0.54 | 0.53, 0.55 | < .001
BE     |  winner |      0.54 | 0.53, 0.54 | < .001
AR     |  winner |      0.58 | 0.57, 0.59 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Plot low-level

CAUTION: same as above low-level!

## CAUTION AFTER REORDER ALWAYS CHECK 
## IF THE MANUAL LABEL ALTERANTIONS MATCH 
## THE ABOVE "AUTOMATIC" PLOT!

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1005"
terms <- c("Period", "Outcome")

type <- "eff"
type <- "pred"

suppressWarnings(rm(list = ls(pattern = "^gg44")))
gg44 <- sjPlot::plot_model(
  get(model), 
  type = type, 
  terms = terms, 
  ## order.terms=c("BE","MI","AR"),  ## This does not work as expected :/
  )

## str(gg44$data)
gg44$data$x <- c(2,2,1,1,3,3)
## gg44 <- gg44 + scale_x_discrete(labels = c("BE", "MI", "ARRR"))
gg44 <- gg44 + scale_x_continuous(
  breaks=c(1,2,3),
  labels=c("_BE", "_MI", "_AR"))
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-sjplot-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg44, width=8, height=6)
gg44

GGEffects: Period x Outcome: DIFF

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-BE  |   loser-loser |    -0.04 | -0.05, -0.02 | < .001
MI-AR  |   loser-loser |     0.06 |  0.04,  0.09 | < .001
MI-MI  |  loser-winner |    -0.07 | -0.09, -0.05 | < .001
MI-BE  |  loser-winner |    -0.06 | -0.08, -0.04 | < .001
MI-AR  |  loser-winner |    -0.11 | -0.13, -0.08 | < .001
BE-AR  |   loser-loser |     0.10 |  0.08,  0.12 | < .001
BE-MI  |  loser-winner |    -0.03 | -0.05, -0.02 | < .001
BE-BE  |  loser-winner |    -0.03 | -0.04, -0.01 | < .001
BE-AR  |  loser-winner |    -0.07 | -0.08, -0.05 | < .001
AR-MI  |  loser-winner |    -0.13 | -0.15, -0.11 | < .001
AR-BE  |  loser-winner |    -0.12 | -0.15, -0.10 | < .001
AR-AR  |  loser-winner |    -0.17 | -0.19, -0.14 | < .001
MI-BE  | winner-winner | 5.48e-03 | -0.01,  0.02 | 0.311 
MI-AR  | winner-winner |    -0.04 | -0.05, -0.02 | < .001
BE-AR  | winner-winner |    -0.04 | -0.06, -0.03 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: NULL

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
extra <- "1006"
terms <- c("Time", "Period", "Outcome")
terms <- c("Time", "Outcome", "Period") ## CAUTION
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

gg88$data$facet <- factor(
  case_when(
    gg88$data$facet == "BE" ~ "Before",
    gg88$data$facet == "MI" ~ "Middle",
    gg88$data$facet == "AR" ~ "After",
  ),
  levels=c("Before", "Middle", "After"))

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser
Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.73 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.64
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.13, 0.24

Outcome: loser
Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.50
 0.00 |      0.52 | 0.51, 0.52
 0.50 |      0.54 | 0.53, 0.56
 1.00 |      0.57 | 0.56, 0.59

Outcome: loser
Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.43 | 0.38, 0.48
-0.50 |      0.42 | 0.39, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Outcome: winner
Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.56, 0.62
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.48 | 0.46, 0.49
 1.00 |      0.42 | 0.39, 0.45

Outcome: winner
Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.50 | 0.49, 0.51
-0.50 |      0.52 | 0.51, 0.53
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.58 | 0.56, 0.59

Outcome: winner
Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.63, 0.68
-0.50 |      0.61 | 0.59, 0.63
 0.00 |      0.57 | 0.56, 0.59
 0.50 |      0.54 | 0.53, 0.54
 1.00 |      0.50 | 0.49, 0.51

Adjusted for:
* Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Outcome | Period | Slope |       95% CI |      p
------------------------------------------------
loser   |     MI | -0.27 | -0.33, -0.21 | < .001
loser   |     BE |  0.06 |  0.05,  0.07 | < .001
loser   |     AR | -0.02 | -0.05,  0.01 | 0.173 
winner  |     MI | -0.11 | -0.15, -0.08 | < .001
winner  |     BE |  0.04 |  0.03,  0.05 | < .001
winner  |     AR | -0.08 | -0.09, -0.06 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: DIFF

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Outcome       | Period | Contrast |       95% CI |      p
---------------------------------------------------------
loser-loser   |  MI-BE |    -0.33 | -0.39, -0.26 | < .001
loser-loser   |  MI-AR |    -0.25 | -0.32, -0.18 | < .001
loser-winner  |  MI-MI |    -0.16 | -0.23, -0.08 | < .001
loser-winner  |  MI-BE |    -0.31 | -0.37, -0.24 | < .001
loser-winner  |  MI-AR |    -0.19 | -0.26, -0.13 | < .001
loser-loser   |  BE-AR |     0.08 |  0.05,  0.11 | < .001
loser-winner  |  BE-MI |     0.17 |  0.13,  0.21 | < .001
loser-winner  |  BE-BE |     0.02 |  0.01,  0.03 | 0.005 
loser-winner  |  BE-AR |     0.13 |  0.11,  0.15 | < .001
loser-winner  |  AR-MI |     0.09 |  0.05,  0.14 | < .001
loser-winner  |  AR-BE |    -0.06 | -0.09, -0.03 | < .001
loser-winner  |  AR-AR |     0.06 |  0.02,  0.09 | < .001
winner-winner |  MI-BE |    -0.15 | -0.19, -0.11 | < .001
winner-winner |  MI-AR |    -0.04 | -0.08,  0.00 | 0.071 
winner-winner |  BE-AR |     0.11 |  0.10,  0.13 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

Extra Plot

pp(model);
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
terms <- c("Time", "Outcome", "Period")

suppressWarnings(rm(list = ls(pattern = "^gg44")))
gg44 <- sjPlot::plot_model(
          get(model),
          type="emm",
          terms=terms) 

gg44$data$facet <- factor(
  case_when(
    gg44$data$facet == "BE" ~ "Before", 
    gg44$data$facet == "MI" ~ "Middle", 
    gg44$data$facet == "AR" ~ "After", 
  ), 
  levels=c("Before", "Middle", "After"))


ggsave(file = "main-fig-test-0001.png", plot = gg44, width=8, height=6)
gg44

Check slopes

## TODO CHECK
library(broom.helpers)
get(model) %>%
  gtsummary::tbl_regression(
    tidy_fun = broom.helpers::tidy_avg_slopes,
    estimate_fun = scales::label_percent(style_positive = "plus")
  ) %>%
  gtsummary::bold_labels()
Characteristic Average Marginal Effects 95% CI1 p-value
Outcome


    winner - loser +6.97% +5.961%, +7.984% <0.001
Period


    AR - MI -0.39% -1.781%, +1.001% 0.6
    BE - MI +0.03% -0.958%, +1.018% >0.9
Time


    dY/dX -1.10% -1.873%, -0.327% 0.005
1 CI = Confidence Interval

Model 05: Time x Period x Outcome + Concreteness

Fit

model <- "fit05aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
   Data: df0
Control: control

REML criterion at convergence: 23238.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.2491 -0.5630 -0.0054  0.5633  7.4018 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004634 0.06807       
          Time        0.003351 0.05788  -0.06
 Residual             0.065812 0.25654       
Number of obs: 169996, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  2.689e-01  1.051e-02  3.757e+04  25.579  < 2e-16 ***
Time                        -2.665e-01  3.229e-02  1.606e+05  -8.254  < 2e-16 ***
PeriodBE                     6.057e-02  6.859e-03  1.693e+05   8.831  < 2e-16 ***
PeriodAR                    -4.784e-02  1.138e-02  1.686e+05  -4.202 2.65e-05 ***
Outcomewinner                7.581e-02  8.897e-03  7.787e+03   8.521  < 2e-16 ***
Concreteness                 2.234e-01  8.932e-03  1.694e+05  25.014  < 2e-16 ***
Time:PeriodBE                3.236e-01  3.245e-02  1.690e+05   9.973  < 2e-16 ***
Time:PeriodAR                2.525e-01  3.489e-02  1.692e+05   7.238 4.59e-13 ***
Time:Outcomewinner           1.506e-01  3.765e-02  1.587e+05   4.000 6.33e-05 ***
PeriodBE:Outcomewinner      -5.406e-02  8.156e-03  1.694e+05  -6.629 3.39e-11 ***
PeriodAR:Outcomewinner       8.599e-02  1.304e-02  1.692e+05   6.594 4.29e-11 ***
Time:PeriodBE:Outcomewinner -1.710e-01  3.786e-02  1.692e+05  -4.516 6.32e-06 ***
Time:PeriodAR:Outcomewinner -2.065e-01  4.045e-02  1.693e+05  -5.105 3.32e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn Cncrtn Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.506                                                                             
PeriodBE    -0.576  0.769                                                                      
PeriodAR    -0.332  0.471  0.514                                                               
Outcomewnnr -0.573  0.594  0.671  0.397                                                        
Concretenss -0.714  0.005  0.012 -0.006 -0.008                                                 
Time:PerdBE  0.502 -0.985 -0.722 -0.469 -0.589 -0.005                                          
Time:PerdAR  0.464 -0.911 -0.713 -0.750 -0.550  0.002  0.907                                   
Tm:Otcmwnnr  0.436 -0.858 -0.659 -0.404 -0.704 -0.007  0.845  0.782                            
PrdBE:Otcmw  0.478 -0.646 -0.841 -0.432 -0.773 -0.001  0.607  0.600  0.765                     
PrdAR:Otcmw  0.295 -0.411 -0.448 -0.873 -0.478 -0.003  0.410  0.655  0.485  0.520              
Tm:PrdBE:Ot -0.432  0.844  0.619  0.402  0.697  0.007 -0.857 -0.778 -0.982 -0.708 -0.482       
Tm:PrdAR:Ot -0.407  0.786  0.615  0.647  0.654  0.007 -0.783 -0.863 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
# R2 for Mixed Models

  Conditional R2: 0.101
     Marginal R2: 0.022
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.081
  Unadjusted ICC: 0.079
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.065

Model Summary

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169996' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169996' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169996' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169996' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.33, -0.20 <0.001
Period


    BE - MI 0.02 0.01, 0.03 0.002
    AR - MI -0.01 -0.03, 0.00 0.12
    AR - BE -0.03 -0.05, -0.02 <0.001
Outcome


    winner - loser 0.08 0.07, 0.10 <0.001
Concreteness 0.22 0.21, 0.24 <0.001
Time * Period


    Time * BE 0.32 0.26, 0.39 <0.001
    Time * AR 0.25 0.18, 0.32 <0.001
Time * Outcome


    Time * winner 0.15 0.08, 0.22 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.17 -0.25, -0.10 <0.001
    Time * AR * winner -0.21 -0.29, -0.13 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.06

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
parameters::model_parameters(get(model))
# Fixed Effects

Parameter                               | Coefficient |       SE |         95% CI | t(169979) |      p
------------------------------------------------------------------------------------------------------
(Intercept)                             |        0.27 |     0.01 | [ 0.25,  0.29] |     25.58 | < .001
Time                                    |       -0.27 |     0.03 | [-0.33, -0.20] |     -8.25 | < .001
Period [BE]                             |        0.06 | 6.86e-03 | [ 0.05,  0.07] |      8.83 | < .001
Period [AR]                             |       -0.05 |     0.01 | [-0.07, -0.03] |     -4.20 | < .001
Outcome [winner]                        |        0.08 | 8.90e-03 | [ 0.06,  0.09] |      8.52 | < .001
Concreteness                            |        0.22 | 8.93e-03 | [ 0.21,  0.24] |     25.01 | < .001
Time × Period [BE]                      |        0.32 |     0.03 | [ 0.26,  0.39] |      9.97 | < .001
Time × Period [AR]                      |        0.25 |     0.03 | [ 0.18,  0.32] |      7.24 | < .001
Time × Outcome [winner]                 |        0.15 |     0.04 | [ 0.08,  0.22] |      4.00 | < .001
Period [BE] × Outcome [winner]          |       -0.05 | 8.16e-03 | [-0.07, -0.04] |     -6.63 | < .001
Period [AR] × Outcome [winner]          |        0.09 |     0.01 | [ 0.06,  0.11] |      6.59 | < .001
(Time × Period [BE]) × Outcome [winner] |       -0.17 |     0.04 | [-0.25, -0.10] |     -4.52 | < .001
(Time × Period [AR]) × Outcome [winner] |       -0.21 |     0.04 | [-0.29, -0.13] |     -5.10 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.07
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |       -0.06
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

GGEffects: Time: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(-0.25, 1.25))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.72 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.63
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.14, 0.24

Adjusted for:
*       Period =    MI
*      Outcome = loser
* Concreteness =  0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope     |       95% CI |     p
--------------------------------
-9.35e-03 | -0.02,  0.00 | 0.018
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1002"
terms <- c("Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period | Predicted |     95% CI
-------------------------------
MI     |      0.47 | 0.46, 0.49
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.39, 0.43

Adjusted for:
*         Time = -0.07
*      Outcome = loser
* Concreteness =  0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Predicted |     95% CI |      p
----------------------------------------
BE     |      0.51 | 0.50, 0.52 | < .001
MI     |      0.47 | 0.46, 0.49 | < .001
AR     |      0.41 | 0.39, 0.43 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: DIFF

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period | Contrast |     95% CI |      p
---------------------------------------
BE-MI  |     0.04 | 0.02, 0.06 | < .001
BE-AR  |     0.10 | 0.08, 0.12 | < .001
MI-AR  |     0.07 | 0.04, 0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1003"
terms <- c("Time", "Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.72 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.63
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.14, 0.24

Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.50
 0.00 |      0.52 | 0.51, 0.53
 0.50 |      0.55 | 0.53, 0.56
 1.00 |      0.57 | 0.56, 0.59

Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.42 | 0.38, 0.47
-0.50 |      0.42 | 0.38, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Adjusted for:
*      Outcome = loser
* Concreteness =  0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Slope |       95% CI |      p
--------------------------------------
MI     | -0.27 | -0.33, -0.20 | < .001
BE     |  0.06 |  0.05,  0.07 | < .001
AR     | -0.01 | -0.04,  0.01 | 0.329 
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: DIFF

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period | Contrast |       95% CI |      p
-----------------------------------------
MI-BE  |    -0.32 | -0.39, -0.26 | < .001
MI-AR  |    -0.25 | -0.32, -0.18 | < .001
BE-AR  |     0.07 |  0.04,  0.10 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1004"
terms <- c("Time", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.72 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.63
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.14, 0.24

Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.56, 0.62
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.47 | 0.46, 0.49
 1.00 |      0.42 | 0.38, 0.45

Adjusted for:
*       Period =   MI
* Concreteness = 0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Outcome | Slope |       95% CI |      p
---------------------------------------
loser   | -0.27 | -0.33, -0.20 | < .001
winner  | -0.12 | -0.15, -0.08 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: DIFF

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Outcome      | Contrast |       95% CI |      p
-----------------------------------------------
loser-winner |    -0.15 | -0.22, -0.08 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1005"
terms <- c("Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

Period | Predicted |     95% CI
-------------------------------
MI     |      0.47 | 0.46, 0.49
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.39, 0.43

Outcome: winner

Period | Predicted |     95% CI
-------------------------------
MI     |      0.54 | 0.53, 0.55
BE     |      0.54 | 0.53, 0.54
AR     |      0.58 | 0.56, 0.59

Adjusted for:
*         Time = -0.07
* Concreteness =  0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Outcome | Predicted |     95% CI |      p
--------------------------------------------------
MI     |   loser |      0.47 | 0.46, 0.49 | < .001
BE     |   loser |      0.51 | 0.50, 0.52 | < .001
AR     |   loser |      0.41 | 0.39, 0.43 | < .001
MI     |  winner |      0.54 | 0.53, 0.55 | < .001
BE     |  winner |      0.54 | 0.53, 0.54 | < .001
AR     |  winner |      0.58 | 0.56, 0.59 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: DIFF

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-BE  |   loser-loser |    -0.04 | -0.06, -0.02 | < .001
MI-AR  |   loser-loser |     0.07 |  0.04,  0.09 | < .001
MI-MI  |  loser-winner |    -0.07 | -0.09, -0.04 | < .001
MI-BE  |  loser-winner |    -0.06 | -0.08, -0.04 | < .001
MI-AR  |  loser-winner |    -0.10 | -0.12, -0.08 | < .001
BE-AR  |   loser-loser |     0.10 |  0.08,  0.12 | < .001
BE-MI  |  loser-winner |    -0.03 | -0.04, -0.01 | < .001
BE-BE  |  loser-winner |    -0.02 | -0.03, -0.01 | < .001
BE-AR  |  loser-winner |    -0.06 | -0.08, -0.05 | < .001
AR-MI  |  loser-winner |    -0.13 | -0.16, -0.11 | < .001
AR-BE  |  loser-winner |    -0.13 | -0.15, -0.10 | < .001
AR-AR  |  loser-winner |    -0.17 | -0.19, -0.14 | < .001
MI-BE  | winner-winner | 3.88e-03 | -0.01,  0.01 | 0.473 
MI-AR  | winner-winner |    -0.04 | -0.05, -0.02 | < .001
BE-AR  | winner-winner |    -0.04 | -0.05, -0.03 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1006"
terms <- c("Time", "Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.72 | 0.65, 0.80
-0.50 |      0.59 | 0.55, 0.63
 0.00 |      0.46 | 0.44, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.19 | 0.14, 0.24

Period: MI
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.56, 0.62
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.47 | 0.46, 0.49
 1.00 |      0.42 | 0.38, 0.45

Period: BE
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.50
 0.00 |      0.52 | 0.51, 0.53
 0.50 |      0.55 | 0.53, 0.56
 1.00 |      0.57 | 0.56, 0.59

Period: BE
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.50 | 0.49, 0.51
-0.50 |      0.52 | 0.51, 0.53
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.58 | 0.56, 0.59

Period: AR
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.42 | 0.38, 0.47
-0.50 |      0.42 | 0.38, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Period: AR
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.64 | 0.62, 0.67
-0.50 |      0.61 | 0.59, 0.62
 0.00 |      0.57 | 0.56, 0.58
 0.50 |      0.54 | 0.53, 0.54
 1.00 |      0.50 | 0.49, 0.51

Adjusted for:
* Concreteness = 0.84
*         Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Outcome | Slope |       95% CI |      p
------------------------------------------------
MI     |   loser | -0.27 | -0.33, -0.20 | < .001
MI     |  winner | -0.12 | -0.15, -0.08 | < .001
BE     |   loser |  0.06 |  0.05,  0.07 | < .001
BE     |  winner |  0.04 |  0.03,  0.05 | < .001
AR     |   loser | -0.01 | -0.04,  0.01 | 0.329 
AR     |  winner | -0.07 | -0.08, -0.05 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: DIFF

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-MI  |  loser-winner |    -0.15 | -0.22, -0.08 | < .001
MI-BE  |   loser-loser |    -0.32 | -0.39, -0.26 | < .001
MI-BE  |  loser-winner |    -0.30 | -0.37, -0.24 | < .001
MI-AR  |   loser-loser |    -0.25 | -0.32, -0.18 | < .001
MI-AR  |  loser-winner |    -0.20 | -0.26, -0.13 | < .001
MI-BE  |  winner-loser |    -0.17 | -0.21, -0.13 | < .001
MI-BE  | winner-winner |    -0.15 | -0.19, -0.11 | < .001
MI-AR  |  winner-loser |    -0.10 | -0.15, -0.05 | < .001
MI-AR  | winner-winner |    -0.05 | -0.09, -0.01 | 0.025 
BE-BE  |  loser-winner |     0.02 |  0.01,  0.03 | 0.005 
BE-AR  |   loser-loser |     0.07 |  0.04,  0.10 | < .001
BE-AR  |  loser-winner |     0.13 |  0.11,  0.15 | < .001
BE-AR  |  winner-loser |     0.05 |  0.02,  0.08 | < .001
BE-AR  | winner-winner |     0.11 |  0.09,  0.12 | < .001
AR-AR  |  loser-winner |     0.06 |  0.02,  0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Concreteness: NULL

pp(model);
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
extra <- "1007"
terms <- c("Concreteness")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Concreteness | Predicted |     95% CI
-------------------------------------
        0.00 |      0.29 | 0.26, 0.31
        0.20 |      0.33 | 0.31, 0.35
        0.40 |      0.38 | 0.36, 0.40
        0.60 |      0.42 | 0.40, 0.44
        0.80 |      0.47 | 0.45, 0.48
        1.00 |      0.51 | 0.49, 0.53

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Concreteness

Slope |     95% CI |      p
---------------------------
0.22  | 0.21, 0.24 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 06: Time x Period x Outcome + Readability

Fit

model <- "fit06aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + Readability,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + Readability
   Data: df0
Control: control

REML criterion at convergence: 21704.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.2117 -0.5576 -0.0051  0.5653  7.2554 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004721 0.06871       
          Time        0.003246 0.05698  -0.09
 Residual             0.065217 0.25538       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  5.839e-01  7.839e-03  1.357e+04  74.487  < 2e-16 ***
Time                        -2.731e-01  3.213e-02  1.609e+05  -8.501  < 2e-16 ***
PeriodBE                     6.298e-02  6.826e-03  1.693e+05   9.226  < 2e-16 ***
PeriodAR                    -5.386e-02  1.133e-02  1.686e+05  -4.753 2.00e-06 ***
Outcomewinner                6.272e-02  8.896e-03  7.588e+03   7.051 1.93e-12 ***
Readability                 -1.815e-01  3.894e-03  1.697e+05 -46.620  < 2e-16 ***
Time:PeriodBE                3.387e-01  3.229e-02  1.690e+05  10.488  < 2e-16 ***
Time:PeriodAR                2.578e-01  3.472e-02  1.692e+05   7.423 1.15e-13 ***
Time:Outcomewinner           1.778e-01  3.747e-02  1.591e+05   4.746 2.08e-06 ***
PeriodBE:Outcomewinner      -5.141e-02  8.118e-03  1.694e+05  -6.333 2.41e-10 ***
PeriodAR:Outcomewinner       9.182e-02  1.298e-02  1.692e+05   7.074 1.51e-12 ***
Time:PeriodBE:Outcomewinner -2.008e-01  3.769e-02  1.692e+05  -5.328 9.94e-08 ***
Time:PeriodAR:Outcomewinner -2.384e-01  4.026e-02  1.693e+05  -5.922 3.18e-09 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn Rdblty Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.673                                                                             
PeriodBE    -0.753  0.769                                                                      
PeriodAR    -0.453  0.471  0.513                                                               
Outcomewnnr -0.787  0.592  0.667  0.395                                                        
Readability -0.348  0.002 -0.014  0.014  0.036                                                 
Time:PerdBE  0.668 -0.985 -0.722 -0.469 -0.587 -0.007                                          
Time:PerdAR  0.623 -0.912 -0.713 -0.750 -0.548 -0.004  0.907                                   
Tm:Otcmwnnr  0.581 -0.857 -0.659 -0.404 -0.703 -0.012  0.845  0.782                            
PrdBE:Otcmw  0.639 -0.647 -0.841 -0.432 -0.770 -0.006  0.607  0.600  0.765                     
PrdAR:Otcmw  0.394 -0.411 -0.448 -0.873 -0.476 -0.008  0.410  0.655  0.485  0.520              
Tm:PrdBE:Ot -0.575  0.844  0.618  0.402  0.694  0.013 -0.857 -0.778 -0.982 -0.709 -0.482       
Tm:PrdAR:Ot -0.540  0.786  0.615  0.647  0.652  0.013 -0.783 -0.862 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
# R2 for Mixed Models

  Conditional R2: 0.111
     Marginal R2: 0.032
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.082
  Unadjusted ICC: 0.080
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.066

Model Summary

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.34, -0.21 <0.001
Period


    BE - MI 0.02 0.01, 0.03 <0.001
    AR - MI -0.02 -0.04, 0.00 0.057
    AR - BE -0.04 -0.05, -0.02 <0.001
Outcome


    winner - loser 0.07 0.06, 0.09 <0.001
Readability -0.18 -0.19, -0.17 <0.001
Time * Period


    Time * BE 0.34 0.28, 0.40 <0.001
    Time * AR 0.26 0.19, 0.33 <0.001
Time * Outcome


    Time * winner 0.18 0.10, 0.25 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.09 0.07, 0.12 <0.001
Time * Period * Outcome


    Time * BE * winner -0.20 -0.27, -0.13 <0.001
    Time * AR * winner -0.24 -0.32, -0.16 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.09

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
parameters::model_parameters(get(model))
# Fixed Effects

Parameter                               | Coefficient |       SE |         95% CI | t(169980) |      p
------------------------------------------------------------------------------------------------------
(Intercept)                             |        0.58 | 7.84e-03 | [ 0.57,  0.60] |     74.49 | < .001
Time                                    |       -0.27 |     0.03 | [-0.34, -0.21] |     -8.50 | < .001
Period [BE]                             |        0.06 | 6.83e-03 | [ 0.05,  0.08] |      9.23 | < .001
Period [AR]                             |       -0.05 |     0.01 | [-0.08, -0.03] |     -4.75 | < .001
Outcome [winner]                        |        0.06 | 8.90e-03 | [ 0.05,  0.08] |      7.05 | < .001
Readability                             |       -0.18 | 3.89e-03 | [-0.19, -0.17] |    -46.62 | < .001
Time × Period [BE]                      |        0.34 |     0.03 | [ 0.28,  0.40] |     10.49 | < .001
Time × Period [AR]                      |        0.26 |     0.03 | [ 0.19,  0.33] |      7.42 | < .001
Time × Outcome [winner]                 |        0.18 |     0.04 | [ 0.10,  0.25] |      4.75 | < .001
Period [BE] × Outcome [winner]          |       -0.05 | 8.12e-03 | [-0.07, -0.04] |     -6.33 | < .001
Period [AR] × Outcome [winner]          |        0.09 |     0.01 | [ 0.07,  0.12] |      7.07 | < .001
(Time × Period [BE]) × Outcome [winner] |       -0.20 |     0.04 | [-0.27, -0.13] |     -5.33 | < .001
(Time × Period [AR]) × Outcome [winner] |       -0.24 |     0.04 | [-0.32, -0.16] |     -5.92 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.07
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |       -0.09
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

GGEffects: Time: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(-0.25, 1.25))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.56, 0.64
 0.00 |      0.47 | 0.45, 0.48
 0.50 |      0.33 | 0.31, 0.35
 1.00 |      0.19 | 0.14, 0.25

Adjusted for:
*      Period =    MI
*     Outcome = loser
* Readability =  0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope     |      95% CI |     p
-------------------------------
-5.03e-03 | -0.01, 0.00 | 0.199
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1002"
terms <- c("Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.47, 0.50
BE     |      0.52 | 0.52, 0.53
AR     |      0.41 | 0.39, 0.43

Adjusted for:
*        Time = -0.07
*     Outcome = loser
* Readability =  0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Predicted |     95% CI |      p
----------------------------------------
BE     |      0.52 | 0.52, 0.53 | < .001
MI     |      0.48 | 0.47, 0.50 | < .001
AR     |      0.41 | 0.39, 0.43 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: DIFF

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period | Contrast |     95% CI |      p
---------------------------------------
BE-MI  |     0.04 | 0.02, 0.06 | < .001
BE-AR  |     0.11 | 0.09, 0.13 | < .001
MI-AR  |     0.07 | 0.05, 0.10 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1003"
terms <- c("Time", "Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.56, 0.64
 0.00 |      0.47 | 0.45, 0.48
 0.50 |      0.33 | 0.31, 0.35
 1.00 |      0.19 | 0.14, 0.25

Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.50 | 0.49, 0.50
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.59 | 0.58, 0.61

Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.43 | 0.38, 0.47
-0.50 |      0.42 | 0.39, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.40 | 0.38, 0.41

Adjusted for:
*     Outcome = loser
* Readability =  0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Slope |       95% CI |      p
--------------------------------------
MI     | -0.27 | -0.34, -0.21 | < .001
BE     |  0.07 |  0.05,  0.08 | < .001
AR     | -0.02 | -0.04,  0.01 | 0.281 
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: DIFF

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period | Contrast |       95% CI |      p
-----------------------------------------
MI-BE  |    -0.34 | -0.40, -0.28 | < .001
MI-AR  |    -0.26 | -0.33, -0.19 | < .001
BE-AR  |     0.08 |  0.05,  0.11 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1004"
terms <- c("Time", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.56, 0.64
 0.00 |      0.47 | 0.45, 0.48
 0.50 |      0.33 | 0.31, 0.35
 1.00 |      0.19 | 0.14, 0.25

Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.62 | 0.58, 0.67
-0.50 |      0.58 | 0.55, 0.60
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.48 | 0.47, 0.49
 1.00 |      0.43 | 0.40, 0.46

Adjusted for:
*      Period =   MI
* Readability = 0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Outcome | Slope |       95% CI |      p
---------------------------------------
loser   | -0.27 | -0.34, -0.21 | < .001
winner  | -0.10 | -0.13, -0.06 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: DIFF

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Outcome      | Contrast |       95% CI |      p
-----------------------------------------------
loser-winner |    -0.18 | -0.25, -0.10 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1005"
terms <- c("Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.47, 0.50
BE     |      0.52 | 0.52, 0.53
AR     |      0.41 | 0.39, 0.43

Outcome: winner

Period | Predicted |     95% CI
-------------------------------
MI     |      0.53 | 0.52, 0.55
BE     |      0.54 | 0.53, 0.54
AR     |      0.57 | 0.56, 0.58

Adjusted for:
*        Time = -0.07
* Readability =  0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Outcome | Predicted |     95% CI |      p
--------------------------------------------------
MI     |   loser |      0.48 | 0.47, 0.50 | < .001
BE     |   loser |      0.52 | 0.52, 0.53 | < .001
AR     |   loser |      0.41 | 0.39, 0.43 | < .001
MI     |  winner |      0.53 | 0.52, 0.55 | < .001
BE     |  winner |      0.54 | 0.53, 0.54 | < .001
AR     |  winner |      0.57 | 0.56, 0.58 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: DIFF

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period |       Outcome |  Contrast |       95% CI |      p
----------------------------------------------------------
MI-BE  |   loser-loser |     -0.04 | -0.06, -0.02 | < .001
MI-AR  |   loser-loser |      0.07 |  0.05,  0.10 | < .001
MI-MI  |  loser-winner |     -0.05 | -0.07, -0.03 | < .001
MI-BE  |  loser-winner |     -0.05 | -0.07, -0.03 | < .001
MI-AR  |  loser-winner |     -0.09 | -0.11, -0.07 | < .001
BE-AR  |   loser-loser |      0.11 |  0.09,  0.13 | < .001
BE-MI  |  loser-winner |     -0.01 | -0.03,  0.00 | 0.157 
BE-BE  |  loser-winner |     -0.01 | -0.02,  0.00 | 0.027 
BE-AR  |  loser-winner |     -0.05 | -0.06, -0.03 | < .001
AR-MI  |  loser-winner |     -0.12 | -0.15, -0.10 | < .001
AR-BE  |  loser-winner |     -0.12 | -0.15, -0.10 | < .001
AR-AR  |  loser-winner |     -0.16 | -0.18, -0.13 | < .001
MI-BE  | winner-winner | -2.19e-03 | -0.01,  0.01 | 0.684 
MI-AR  | winner-winner |     -0.04 | -0.05, -0.02 | < .001
BE-AR  | winner-winner |     -0.03 | -0.05, -0.02 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1006"
terms <- c("Time", "Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.56, 0.64
 0.00 |      0.47 | 0.45, 0.48
 0.50 |      0.33 | 0.31, 0.35
 1.00 |      0.19 | 0.14, 0.25

Period: MI
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.62 | 0.58, 0.67
-0.50 |      0.58 | 0.55, 0.60
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.48 | 0.47, 0.49
 1.00 |      0.43 | 0.40, 0.46

Period: BE
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.50 | 0.49, 0.50
 0.00 |      0.53 | 0.52, 0.54
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.59 | 0.58, 0.61

Period: BE
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.50 | 0.49, 0.51
-0.50 |      0.52 | 0.51, 0.53
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.58 | 0.57, 0.60

Period: AR
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.43 | 0.38, 0.47
-0.50 |      0.42 | 0.39, 0.45
 0.00 |      0.41 | 0.39, 0.43
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.40 | 0.38, 0.41

Period: AR
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.64 | 0.62, 0.67
-0.50 |      0.60 | 0.59, 0.62
 0.00 |      0.57 | 0.55, 0.58
 0.50 |      0.53 | 0.52, 0.54
 1.00 |      0.49 | 0.48, 0.50

Adjusted for:
* Readability = 0.65
*        Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Outcome | Slope |       95% CI |      p
------------------------------------------------
MI     |   loser | -0.27 | -0.34, -0.21 | < .001
MI     |  winner | -0.10 | -0.13, -0.06 | < .001
BE     |   loser |  0.07 |  0.05,  0.08 | < .001
BE     |  winner |  0.04 |  0.03,  0.05 | < .001
AR     |   loser | -0.02 | -0.04,  0.01 | 0.281 
AR     |  winner | -0.08 | -0.09, -0.06 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: DIFF

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-MI  |  loser-winner |    -0.18 | -0.25, -0.10 | < .001
MI-BE  |   loser-loser |    -0.34 | -0.40, -0.28 | < .001
MI-BE  |  loser-winner |    -0.32 | -0.38, -0.25 | < .001
MI-AR  |   loser-loser |    -0.26 | -0.33, -0.19 | < .001
MI-AR  |  loser-winner |    -0.20 | -0.26, -0.13 | < .001
MI-BE  |  winner-loser |    -0.16 | -0.20, -0.12 | < .001
MI-BE  | winner-winner |    -0.14 | -0.18, -0.10 | < .001
MI-AR  |  winner-loser |    -0.08 | -0.13, -0.03 | < .001
MI-AR  | winner-winner |    -0.02 | -0.06,  0.02 | 0.343 
BE-BE  |  loser-winner |     0.02 |  0.01,  0.04 | 0.001 
BE-AR  |   loser-loser |     0.08 |  0.05,  0.11 | < .001
BE-AR  |  loser-winner |     0.14 |  0.12,  0.16 | < .001
BE-AR  |  winner-loser |     0.06 |  0.03,  0.09 | < .001
BE-AR  | winner-winner |     0.12 |  0.10,  0.13 | < .001
AR-AR  |  loser-winner |     0.06 |  0.03,  0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Readability: NULL

pp(model);
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
extra <- "1007"
terms <- c("Readability")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Readability | Predicted |     95% CI
------------------------------------
         -4 |      1.33 | 1.29, 1.37
         -3 |      1.15 | 1.11, 1.18
         -2 |      0.97 | 0.94, 0.99
         -1 |      0.78 | 0.76, 0.81
          0 |      0.60 | 0.58, 0.62
          1 |      0.42 | 0.40, 0.44
          2 |      0.24 | 0.22, 0.26

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Readability

Slope |       95% CI |      p
-----------------------------
-0.18 | -0.19, -0.17 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 07: Time x Period x Outcome + LogAnger

Fit

model <- "fit07aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
   Data: df0
Control: control

REML criterion at convergence: 23209.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.2181 -0.5621 -0.0081  0.5632  7.4519 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.005086 0.07132       
          Time        0.003457 0.05879  -0.07
 Residual             0.065763 0.25644       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  4.969e-01  7.603e-03  1.069e+04  65.356  < 2e-16 ***
Time                        -2.751e-01  3.228e-02  1.603e+05  -8.522  < 2e-16 ***
PeriodBE                     5.306e-02  6.859e-03  1.693e+05   7.736 1.03e-14 ***
PeriodAR                    -5.514e-02  1.139e-02  1.687e+05  -4.843 1.28e-06 ***
Outcomewinner                7.951e-02  9.016e-03  7.038e+03   8.818  < 2e-16 ***
LogAnger                     1.215e-02  4.725e-04  1.695e+05  25.720  < 2e-16 ***
Time:PeriodBE                3.305e-01  3.243e-02  1.690e+05  10.191  < 2e-16 ***
Time:PeriodAR                2.630e-01  3.488e-02  1.692e+05   7.539 4.75e-14 ***
Time:Outcomewinner           1.655e-01  3.765e-02  1.583e+05   4.397 1.10e-05 ***
PeriodBE:Outcomewinner      -5.222e-02  8.153e-03  1.694e+05  -6.405 1.51e-10 ***
PeriodAR:Outcomewinner       8.866e-02  1.304e-02  1.692e+05   6.801 1.04e-11 ***
Time:PeriodBE:Outcomewinner -1.846e-01  3.785e-02  1.692e+05  -4.876 1.08e-06 ***
Time:PeriodAR:Outcomewinner -2.249e-01  4.043e-02  1.692e+05  -5.562 2.67e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LgAngr Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.696                                                                             
PeriodBE    -0.790  0.768                                                                      
PeriodAR    -0.470  0.471  0.514                                                               
Outcomewnnr -0.806  0.586  0.661  0.391                                                        
LogAnger     0.205 -0.006 -0.030 -0.031  0.008                                                 
Time:PerdBE  0.690 -0.985 -0.721 -0.469 -0.581  0.004                                          
Time:PerdAR  0.646 -0.911 -0.713 -0.750 -0.542  0.014  0.907                                   
Tm:Otcmwnnr  0.598 -0.858 -0.659 -0.404 -0.695  0.009  0.845  0.781                            
PrdBE:Otcmw  0.661 -0.646 -0.841 -0.432 -0.763  0.007  0.607  0.600  0.764                     
PrdAR:Otcmw  0.406 -0.411 -0.448 -0.873 -0.471  0.006  0.410  0.655  0.485  0.519              
Tm:PrdBE:Ot -0.592  0.844  0.618  0.402  0.687 -0.007 -0.857 -0.778 -0.982 -0.708 -0.482       
Tm:PrdAR:Ot -0.557  0.786  0.615  0.647  0.645 -0.011 -0.783 -0.863 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
# R2 for Mixed Models

  Conditional R2: 0.108
     Marginal R2: 0.022
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.087
  Unadjusted ICC: 0.085
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.071

Model Summary

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.28 -0.34, -0.21 <0.001
Period


    BE - MI 0.01 0.00, 0.02 0.087
    AR - MI -0.02 -0.04, 0.00 0.016
    AR - BE -0.03 -0.05, -0.02 <0.001
Outcome


    winner - loser 0.09 0.08, 0.10 <0.001
LogAnger 0.01 0.01, 0.01 <0.001
Time * Period


    Time * BE 0.33 0.27, 0.39 <0.001
    Time * AR 0.26 0.19, 0.33 <0.001
Time * Outcome


    Time * winner 0.17 0.09, 0.24 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.18 -0.26, -0.11 <0.001
    Time * AR * winner -0.22 -0.30, -0.15 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.07

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

Model Parameters

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
parameters::model_parameters(get(model))
# Fixed Effects

Parameter                               | Coefficient |       SE |         95% CI | t(169980) |      p
------------------------------------------------------------------------------------------------------
(Intercept)                             |        0.50 | 7.60e-03 | [ 0.48,  0.51] |     65.36 | < .001
Time                                    |       -0.28 |     0.03 | [-0.34, -0.21] |     -8.52 | < .001
Period [BE]                             |        0.05 | 6.86e-03 | [ 0.04,  0.07] |      7.74 | < .001
Period [AR]                             |       -0.06 |     0.01 | [-0.08, -0.03] |     -4.84 | < .001
Outcome [winner]                        |        0.08 | 9.02e-03 | [ 0.06,  0.10] |      8.82 | < .001
LogAnger                                |        0.01 | 4.73e-04 | [ 0.01,  0.01] |     25.72 | < .001
Time × Period [BE]                      |        0.33 |     0.03 | [ 0.27,  0.39] |     10.19 | < .001
Time × Period [AR]                      |        0.26 |     0.03 | [ 0.19,  0.33] |      7.54 | < .001
Time × Outcome [winner]                 |        0.17 |     0.04 | [ 0.09,  0.24] |      4.40 | < .001
Period [BE] × Outcome [winner]          |       -0.05 | 8.15e-03 | [-0.07, -0.04] |     -6.41 | < .001
Period [AR] × Outcome [winner]          |        0.09 |     0.01 | [ 0.06,  0.11] |      6.80 | < .001
(Time × Period [BE]) × Outcome [winner] |       -0.18 |     0.04 | [-0.26, -0.11] |     -4.88 | < .001
(Time × Period [AR]) × Outcome [winner] |       -0.22 |     0.04 | [-0.30, -0.15] |     -5.56 | < .001

# Random Effects

Parameter                  | Coefficient
----------------------------------------
SD (Intercept: Name)       |        0.07
SD (Time: Name)            |        0.06
Cor (Intercept~Time: Name) |       -0.07
SD (Residual)              |        0.26

Uncertainty intervals (equal-tailed) and p-values (two-tailed) computed using a Wald t-distribution approximation.

GGEffects: Time: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1001"
terms <- c("Time")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,) +
  geom_vline(xintercept=0/180, linetype="dashed", color="blue", lwd=1) +
  ## geom_vline(xintercept=32/180, linetype="dashed", color="black", lwd=0.75) +
  geom_vline(xintercept=63/180, linetype="dashed", color="red", lwd=1) +
  coord_cartesian(ylim = c(-0.25, 1.25))
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.55, 0.64
 0.00 |      0.46 | 0.45, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.18 | 0.13, 0.24

Adjusted for:
*   Period =    MI
*  Outcome = loser
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Slope     |       95% CI |     p
--------------------------------
-9.53e-03 | -0.02,  0.00 | 0.016
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1002"
terms <- c("Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.46, 0.50
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.38, 0.43

Adjusted for:
*     Time = -0.07
*  Outcome = loser
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Predicted |     95% CI |      p
----------------------------------------
BE     |      0.51 | 0.50, 0.52 | < .001
MI     |      0.48 | 0.46, 0.50 | < .001
AR     |      0.41 | 0.38, 0.43 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period: DIFF

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period | Contrast |     95% CI |      p
---------------------------------------
BE-MI  |     0.03 | 0.01, 0.05 | < .001
BE-AR  |     0.10 | 0.08, 0.12 | < .001
MI-AR  |     0.07 | 0.05, 0.10 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: NULL

extra <- "1003"
terms <- c("Time", "Period")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.55, 0.64
 0.00 |      0.46 | 0.45, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.18 | 0.13, 0.24

Period: BE

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.49
 0.00 |      0.51 | 0.50, 0.52
 0.50 |      0.54 | 0.53, 0.55
 1.00 |      0.57 | 0.55, 0.58

Period: AR

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.42 | 0.37, 0.46
-0.50 |      0.41 | 0.38, 0.44
 0.00 |      0.40 | 0.38, 0.42
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Adjusted for:
*  Outcome = loser
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Slope |       95% CI |      p
--------------------------------------
MI     | -0.28 | -0.34, -0.21 | < .001
BE     |  0.06 |  0.04,  0.07 | < .001
AR     | -0.01 | -0.04,  0.02 | 0.399 
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period: DIFF

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period | Contrast |       95% CI |      p
-----------------------------------------
MI-BE  |    -0.33 | -0.39, -0.27 | < .001
MI-AR  |    -0.26 | -0.33, -0.19 | < .001
BE-AR  |     0.07 |  0.04,  0.10 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1004"
terms <- c("Time", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.55, 0.64
 0.00 |      0.46 | 0.45, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.18 | 0.13, 0.24

Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.57, 0.62
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.48 | 0.47, 0.50
 1.00 |      0.43 | 0.40, 0.46

Adjusted for:
*   Period =    MI
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Outcome | Slope |       95% CI |      p
---------------------------------------
loser   | -0.28 | -0.34, -0.21 | < .001
winner  | -0.11 | -0.15, -0.07 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Outcome: DIFF

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Outcome      | Contrast |       95% CI |      p
-----------------------------------------------
loser-winner |    -0.17 | -0.24, -0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1005"
terms <- c("Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Outcome: loser

Period | Predicted |     95% CI
-------------------------------
MI     |      0.48 | 0.46, 0.50
BE     |      0.51 | 0.50, 0.52
AR     |      0.41 | 0.38, 0.43

Outcome: winner

Period | Predicted |     95% CI
-------------------------------
MI     |      0.55 | 0.54, 0.56
BE     |      0.54 | 0.53, 0.55
AR     |      0.58 | 0.57, 0.59

Adjusted for:
*     Time = -0.07
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
Period | Outcome | Predicted |     95% CI |      p
--------------------------------------------------
MI     |   loser |      0.48 | 0.46, 0.50 | < .001
BE     |   loser |      0.51 | 0.50, 0.52 | < .001
AR     |   loser |      0.41 | 0.38, 0.43 | < .001
MI     |  winner |      0.55 | 0.54, 0.56 | < .001
BE     |  winner |      0.54 | 0.53, 0.55 | < .001
AR     |  winner |      0.58 | 0.57, 0.59 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Period x Outcome: DIFF

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# Pairwise comparisons

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-BE  |   loser-loser |    -0.03 | -0.05, -0.01 | < .001
MI-AR  |   loser-loser |     0.07 |  0.05,  0.10 | < .001
MI-MI  |  loser-winner |    -0.07 | -0.09, -0.05 | < .001
MI-BE  |  loser-winner |    -0.06 | -0.08, -0.04 | < .001
MI-AR  |  loser-winner |    -0.10 | -0.12, -0.08 | < .001
BE-AR  |   loser-loser |     0.10 |  0.08,  0.12 | < .001
BE-MI  |  loser-winner |    -0.04 | -0.05, -0.02 | < .001
BE-BE  |  loser-winner |    -0.03 | -0.04, -0.02 | < .001
BE-AR  |  loser-winner |    -0.07 | -0.08, -0.05 | < .001
AR-MI  |  loser-winner |    -0.14 | -0.17, -0.12 | < .001
AR-BE  |  loser-winner |    -0.13 | -0.16, -0.11 | < .001
AR-AR  |  loser-winner |    -0.17 | -0.20, -0.15 | < .001
MI-BE  | winner-winner | 9.09e-03 |  0.00,  0.02 | 0.092 
MI-AR  | winner-winner |    -0.03 | -0.05, -0.02 | < .001
BE-AR  | winner-winner |    -0.04 | -0.05, -0.03 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1006"
terms <- c("Time", "Period", "Outcome")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = FALSE, dot_alpha = 0.05)

file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

Period: MI
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.74 | 0.66, 0.81
-0.50 |      0.60 | 0.55, 0.64
 0.00 |      0.46 | 0.45, 0.47
 0.50 |      0.32 | 0.30, 0.35
 1.00 |      0.18 | 0.13, 0.24

Period: MI
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.65 | 0.60, 0.69
-0.50 |      0.59 | 0.57, 0.62
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.48 | 0.47, 0.50
 1.00 |      0.43 | 0.40, 0.46

Period: BE
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.46 | 0.45, 0.47
-0.50 |      0.49 | 0.48, 0.49
 0.00 |      0.51 | 0.50, 0.52
 0.50 |      0.54 | 0.53, 0.55
 1.00 |      0.57 | 0.55, 0.58

Period: BE
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.50 | 0.49, 0.51
-0.50 |      0.52 | 0.51, 0.53
 0.00 |      0.54 | 0.53, 0.55
 0.50 |      0.56 | 0.55, 0.57
 1.00 |      0.58 | 0.56, 0.59

Period: AR
Outcome: loser

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.42 | 0.37, 0.46
-0.50 |      0.41 | 0.38, 0.44
 0.00 |      0.40 | 0.38, 0.42
 0.50 |      0.40 | 0.39, 0.41
 1.00 |      0.39 | 0.38, 0.41

Period: AR
Outcome: winner

 Time | Predicted |     95% CI
------------------------------
-1.00 |      0.64 | 0.62, 0.67
-0.50 |      0.61 | 0.59, 0.63
 0.00 |      0.57 | 0.56, 0.58
 0.50 |      0.54 | 0.53, 0.54
 1.00 |      0.50 | 0.49, 0.51

Adjusted for:
* LogAnger = -3.04
*     Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for Time

Period | Outcome | Slope |       95% CI |      p
------------------------------------------------
MI     |   loser | -0.28 | -0.34, -0.21 | < .001
MI     |  winner | -0.11 | -0.15, -0.07 | < .001
BE     |   loser |  0.06 |  0.04,  0.07 | < .001
BE     |  winner |  0.04 |  0.03,  0.05 | < .001
AR     |   loser | -0.01 | -0.04,  0.02 | 0.399 
AR     |  winner | -0.07 | -0.09, -0.06 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: Time x Period x Outcome: DIFF

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
test2 <- ggeffects::test_predictions(get(model), terms=terms, test="pairwise", p_adjust="fdr")
test2 %>% print()
# (Average) Linear trend for Time

Period |       Outcome | Contrast |       95% CI |      p
---------------------------------------------------------
MI-MI  |  loser-winner |    -0.17 | -0.24, -0.09 | < .001
MI-BE  |   loser-loser |    -0.33 | -0.39, -0.27 | < .001
MI-BE  |  loser-winner |    -0.31 | -0.38, -0.25 | < .001
MI-AR  |   loser-loser |    -0.26 | -0.33, -0.19 | < .001
MI-AR  |  loser-winner |    -0.20 | -0.27, -0.14 | < .001
MI-BE  |  winner-loser |    -0.17 | -0.20, -0.13 | < .001
MI-BE  | winner-winner |    -0.15 | -0.18, -0.11 | < .001
MI-AR  |  winner-loser |    -0.10 | -0.14, -0.05 | < .001
MI-AR  | winner-winner |    -0.04 | -0.08,  0.00 | 0.063 
BE-BE  |  loser-winner |     0.02 |  0.00,  0.03 | 0.009 
BE-AR  |   loser-loser |     0.07 |  0.04,  0.10 | < .001
BE-AR  |  loser-winner |     0.13 |  0.11,  0.15 | < .001
BE-AR  |  winner-loser |     0.05 |  0.02,  0.08 | 0.001 
BE-AR  | winner-winner |     0.11 |  0.09,  0.12 | < .001
AR-AR  |  loser-winner |     0.06 |  0.03,  0.09 | < .001
test2tab <- ggeffects::print_html(test2)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.html"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test2.docx"))
test2tab %>% tinytable::save_tt(file, overwrite=TRUE)

GGEffects: LogAnger: NULL

pp(model);
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
extra <- "1007"
terms <- c("LogAnger")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogAnger | Predicted |     95% CI
---------------------------------
      -7 |      0.43 | 0.41, 0.45
      -6 |      0.44 | 0.42, 0.46
      -5 |      0.45 | 0.44, 0.47
      -4 |      0.47 | 0.45, 0.48
      -3 |      0.48 | 0.46, 0.50
      -2 |      0.49 | 0.47, 0.51
      -1 |      0.50 | 0.49, 0.52
       0 |      0.52 | 0.50, 0.53

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogAnger

Slope |     95% CI |      p
---------------------------
0.01  | 0.01, 0.01 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 08: Time x Period x Outcome + LogFear

Fit

model <- "fit08aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogFear,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
   Data: df0
Control: control

REML criterion at convergence: 22200.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.1394 -0.5623 -0.0122  0.5580  7.2477 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004915 0.07011       
          Time        0.003382 0.05815  -0.09
 Residual             0.065386 0.25571       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  5.038e-01  7.481e-03  1.066e+04  67.340  < 2e-16 ***
Time                        -2.721e-01  3.218e-02  1.605e+05  -8.455  < 2e-16 ***
PeriodBE                     4.325e-02  6.845e-03  1.693e+05   6.319 2.65e-10 ***
PeriodAR                    -5.706e-02  1.135e-02  1.686e+05  -5.028 4.97e-07 ***
Outcomewinner                6.825e-02  8.954e-03  7.268e+03   7.623 2.80e-14 ***
LogFear                      1.589e-02  3.879e-04  1.691e+05  40.951  < 2e-16 ***
Time:PeriodBE                3.238e-01  3.234e-02  1.690e+05  10.012  < 2e-16 ***
Time:PeriodAR                2.629e-01  3.477e-02  1.692e+05   7.561 4.02e-14 ***
Time:Outcomewinner           1.770e-01  3.753e-02  1.585e+05   4.717 2.40e-06 ***
PeriodBE:Outcomewinner      -4.512e-02  8.131e-03  1.694e+05  -5.548 2.89e-08 ***
PeriodAR:Outcomewinner       9.392e-02  1.300e-02  1.692e+05   7.226 5.01e-13 ***
Time:PeriodBE:Outcomewinner -1.940e-01  3.774e-02  1.692e+05  -5.141 2.74e-07 ***
Time:PeriodAR:Outcomewinner -2.449e-01  4.032e-02  1.693e+05  -6.074 1.25e-09 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LogFer Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.705                                                                             
PeriodBE    -0.802  0.768                                                                      
PeriodAR    -0.474  0.471  0.514                                                               
Outcomewnnr -0.820  0.589  0.665  0.393                                                        
LogFear      0.154 -0.001 -0.054 -0.023 -0.026                                                 
Time:PerdBE  0.698 -0.985 -0.721 -0.469 -0.583 -0.003                                          
Time:PerdAR  0.653 -0.911 -0.713 -0.750 -0.545  0.009  0.907                                   
Tm:Otcmwnnr  0.607 -0.857 -0.659 -0.404 -0.699  0.013  0.845  0.782                            
PrdBE:Otcmw  0.672 -0.646 -0.841 -0.432 -0.766  0.026  0.607  0.600  0.765                     
PrdAR:Otcmw  0.412 -0.411 -0.448 -0.873 -0.473  0.013  0.410  0.655  0.485  0.520              
Tm:PrdBE:Ot -0.600  0.844  0.618  0.402  0.690 -0.011 -0.857 -0.778 -0.982 -0.708 -0.482       
Tm:PrdAR:Ot -0.565  0.786  0.615  0.647  0.648 -0.019 -0.782 -0.863 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
# R2 for Mixed Models

  Conditional R2: 0.111
     Marginal R2: 0.029
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.085
  Unadjusted ICC: 0.083
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.069

Model Summary

pp(model);
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.34, -0.21 <0.001
Period


    BE - MI 0.01 -0.01, 0.02 0.6
    AR - MI -0.02 -0.04, 0.00 0.026
    AR - BE -0.02 -0.04, -0.01 <0.001
Outcome


    winner - loser 0.08 0.07, 0.10 <0.001
LogFear 0.02 0.02, 0.02 <0.001
Time * Period


    Time * BE 0.32 0.26, 0.39 <0.001
    Time * AR 0.26 0.19, 0.33 <0.001
Time * Outcome


    Time * winner 0.18 0.10, 0.25 <0.001
Period * Outcome


    BE * winner -0.05 -0.06, -0.03 <0.001
    AR * winner 0.09 0.07, 0.12 <0.001
Time * Period * Outcome


    Time * BE * winner -0.19 -0.27, -0.12 <0.001
    Time * AR * winner -0.24 -0.32, -0.17 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.09

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

GGEffects: LogFear: NULL

pp(model);
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
extra <- "1007"
terms <- c("LogFear")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogFear | Predicted |     95% CI
--------------------------------
     -7 |      0.41 | 0.39, 0.43
     -6 |      0.43 | 0.41, 0.44
     -5 |      0.44 | 0.43, 0.46
     -4 |      0.46 | 0.44, 0.48
     -3 |      0.47 | 0.46, 0.49
     -2 |      0.49 | 0.47, 0.51
     -1 |      0.51 | 0.49, 0.52
      0 |      0.52 | 0.50, 0.54

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogFear

Slope |     95% CI |      p
---------------------------
0.02  | 0.02, 0.02 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 09: Time x Period x Outcome + LogJoy

Fit

model <- "fit09aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
   Data: df0
Control: control

REML criterion at convergence: 15384.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.0062 -0.5850 -0.0298  0.5569  7.6489 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.003971 0.06302       
          Time        0.002568 0.05068  -0.01
 Residual             0.062913 0.25082       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  5.480e-01  7.171e-03  1.294e+04  76.412  < 2e-16 ***
Time                        -2.343e-01  3.152e-02  1.620e+05  -7.434 1.06e-13 ***
PeriodBE                     5.096e-02  6.703e-03  1.693e+05   7.603 2.91e-14 ***
PeriodAR                    -1.867e-02  1.113e-02  1.685e+05  -1.677 0.093459 .  
Outcomewinner                6.016e-02  8.569e-03  8.843e+03   7.021 2.37e-12 ***
LogJoy                       3.452e-02  3.697e-04  1.693e+05  93.370  < 2e-16 ***
Time:PeriodBE                2.784e-01  3.171e-02  1.690e+05   8.781  < 2e-16 ***
Time:PeriodAR                1.994e-01  3.410e-02  1.692e+05   5.847 5.02e-09 ***
Time:Outcomewinner           1.396e-01  3.675e-02  1.609e+05   3.797 0.000146 ***
PeriodBE:Outcomewinner      -3.924e-02  7.973e-03  1.694e+05  -4.922 8.57e-07 ***
PeriodAR:Outcomewinner       8.949e-02  1.274e-02  1.691e+05   7.023 2.19e-12 ***
Time:PeriodBE:Outcomewinner -1.516e-01  3.700e-02  1.692e+05  -4.097 4.19e-05 ***
Time:PeriodAR:Outcomewinner -2.059e-01  3.953e-02  1.693e+05  -5.209 1.90e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LogJoy Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.717                                                                             
PeriodBE    -0.815  0.770                                                                      
PeriodAR    -0.477  0.472  0.513                                                               
Outcomewnnr -0.824  0.602  0.681  0.402                                                        
LogJoy       0.137  0.012 -0.012  0.027 -0.022                                                 
Time:PerdBE  0.713 -0.986 -0.722 -0.470 -0.598 -0.016                                          
Time:PerdAR  0.665 -0.913 -0.713 -0.750 -0.558 -0.016  0.908                                   
Tm:Otcmwnnr  0.616 -0.858 -0.660 -0.405 -0.713 -0.005  0.846  0.783                            
PrdBE:Otcmw  0.686 -0.647 -0.841 -0.431 -0.785  0.020  0.607  0.600  0.766                     
PrdAR:Otcmw  0.420 -0.412 -0.449 -0.873 -0.485  0.002  0.410  0.654  0.485  0.520              
Tm:PrdBE:Ot -0.612  0.845  0.619  0.402  0.707  0.007 -0.857 -0.778 -0.983 -0.709 -0.482       
Tm:PrdAR:Ot -0.575  0.787  0.616  0.647  0.664  0.002 -0.783 -0.862 -0.917 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
# R2 for Mixed Models

  Conditional R2: 0.136
     Marginal R2: 0.069
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.071
  Unadjusted ICC: 0.066
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.059

Model Summary

pp(model);
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.23 -0.30, -0.17 <0.001
Period


    BE - MI 0.02 0.01, 0.03 0.001
    AR - MI 0.02 0.00, 0.04 0.024
    AR - BE 0.00 -0.01, 0.02 >0.9
Outcome


    winner - loser 0.08 0.06, 0.09 <0.001
LogJoy 0.03 0.03, 0.04 <0.001
Time * Period


    Time * BE 0.28 0.22, 0.34 <0.001
    Time * AR 0.20 0.13, 0.27 <0.001
Time * Outcome


    Time * winner 0.14 0.07, 0.21 <0.001
Period * Outcome


    BE * winner -0.04 -0.05, -0.02 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.15 -0.22, -0.08 <0.001
    Time * AR * winner -0.21 -0.28, -0.13 <0.001
Name.sd__(Intercept) 0.06

Name.cor__(Intercept).Time -0.01

Name.sd__Time 0.05

Residual.sd__Observation 0.25

1 CI = Confidence Interval

GGEffects: LogJoy: NULL

pp(model);
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
extra <- "1007"
terms <- c("LogJoy")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogJoy | Predicted |     95% CI
-------------------------------
    -7 |      0.32 | 0.30, 0.34
    -6 |      0.36 | 0.34, 0.37
    -5 |      0.39 | 0.37, 0.41
    -4 |      0.43 | 0.41, 0.44
    -3 |      0.46 | 0.44, 0.48
    -2 |      0.49 | 0.48, 0.51
    -1 |      0.53 | 0.51, 0.55
     0 |      0.56 | 0.55, 0.58

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogJoy

Slope |     95% CI |      p
---------------------------
0.03  | 0.03, 0.04 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 10: Time x Period x Outcome + LogDisgust

Fit

model <- "fit10aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
   Data: df0
Control: control

REML criterion at convergence: 21691.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-7.8851 -0.5683 -0.0108  0.5618  7.4164 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.00447  0.06686       
          Time        0.00303  0.05504  -0.05
 Residual             0.06524  0.25542       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  3.218e-01  7.849e-03  1.452e+04  40.997  < 2e-16 ***
Time                        -2.652e-01  3.212e-02  1.612e+05  -8.257  < 2e-16 ***
PeriodBE                     5.526e-02  6.827e-03  1.693e+05   8.095 5.78e-16 ***
PeriodAR                    -3.307e-02  1.133e-02  1.686e+05  -2.918  0.00352 ** 
Outcomewinner                7.214e-02  8.823e-03  8.051e+03   8.177 3.36e-16 ***
LogDisgust                  -2.505e-02  5.349e-04  1.645e+05 -46.829  < 2e-16 ***
Time:PeriodBE                3.218e-01  3.229e-02  1.690e+05   9.964  < 2e-16 ***
Time:PeriodAR                2.353e-01  3.473e-02  1.692e+05   6.775 1.25e-11 ***
Time:Outcomewinner           1.634e-01  3.746e-02  1.597e+05   4.361 1.30e-05 ***
PeriodBE:Outcomewinner      -4.754e-02  8.119e-03  1.694e+05  -5.855 4.78e-09 ***
PeriodAR:Outcomewinner       8.891e-02  1.298e-02  1.691e+05   6.850 7.43e-12 ***
Time:PeriodBE:Outcomewinner -1.826e-01  3.769e-02  1.692e+05  -4.845 1.27e-06 ***
Time:PeriodAR:Outcomewinner -2.225e-01  4.026e-02  1.693e+05  -5.526 3.29e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LgDsgs Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.671                                                                             
PeriodBE    -0.753  0.769                                                                      
PeriodAR    -0.457  0.471  0.513                                                               
Outcomewnnr -0.765  0.596  0.673  0.398                                                        
LogDisgust   0.367 -0.003  0.010 -0.025  0.013                                                 
Time:PerdBE  0.666 -0.985 -0.722 -0.469 -0.592  0.004                                          
Time:PerdAR  0.624 -0.912 -0.713 -0.750 -0.552  0.010  0.908                                   
Tm:Otcmwnnr  0.573 -0.858 -0.660 -0.404 -0.706 -0.003  0.845  0.782                            
PrdBE:Otcmw  0.630 -0.647 -0.841 -0.431 -0.776 -0.017  0.607  0.600  0.765                     
PrdAR:Otcmw  0.390 -0.412 -0.449 -0.873 -0.480 -0.003  0.410  0.655  0.485  0.520              
Tm:PrdBE:Ot -0.569  0.844  0.619  0.402  0.700  0.003 -0.857 -0.778 -0.982 -0.709 -0.482       
Tm:PrdAR:Ot -0.534  0.787  0.615  0.646  0.657  0.005 -0.783 -0.862 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
# R2 for Mixed Models

  Conditional R2: 0.110
     Marginal R2: 0.035
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.078
  Unadjusted ICC: 0.075
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.063

Model Summary

pp(model);
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.33, -0.20 <0.001
Period


    BE - MI 0.02 0.00, 0.03 0.005
    AR - MI 0.00 -0.01, 0.02 >0.9
    AR - BE -0.01 -0.03, 0.00 0.084
Outcome


    winner - loser 0.08 0.07, 0.10 <0.001
LogDisgust -0.03 -0.03, -0.02 <0.001
Time * Period


    Time * BE 0.32 0.26, 0.39 <0.001
    Time * AR 0.24 0.17, 0.30 <0.001
Time * Outcome


    Time * winner 0.16 0.09, 0.24 <0.001
Period * Outcome


    BE * winner -0.05 -0.06, -0.03 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.18 -0.26, -0.11 <0.001
    Time * AR * winner -0.22 -0.30, -0.14 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.05

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

GGEffects: LogDisgust: NULL

pp(model);
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
extra <- "1007"
terms <- c("LogDisgust")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogDisgust | Predicted |     95% CI
-----------------------------------
        -7 |      0.52 | 0.50, 0.53
        -6 |      0.49 | 0.47, 0.51
        -5 |      0.47 | 0.45, 0.48
        -4 |      0.44 | 0.42, 0.46
        -3 |      0.42 | 0.40, 0.43
        -2 |      0.39 | 0.37, 0.41
        -1 |      0.36 | 0.35, 0.38
         0 |      0.34 | 0.32, 0.36

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogDisgust

Slope |       95% CI |      p
-----------------------------
-0.03 | -0.03, -0.02 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 11: Time x Period x Outcome + LogSadness

Fit

model <- "fit11aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
   Data: df0
Control: control

REML criterion at convergence: 7668.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.5565 -0.5739 -0.0047  0.5684  7.4225 

Random effects:
 Groups   Name        Variance Std.Dev. Corr
 Name     (Intercept) 0.004344 0.06591      
          Time        0.002718 0.05213  0.02
 Residual             0.060066 0.24508      
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df  t value Pr(>|t|)    
(Intercept)                  2.403e-01  7.246e-03  1.182e+04   33.164  < 2e-16 ***
Time                        -2.408e-01  3.083e-02  1.611e+05   -7.813 5.63e-15 ***
PeriodBE                     5.828e-02  6.552e-03  1.693e+05    8.896  < 2e-16 ***
PeriodAR                    -2.750e-02  1.088e-02  1.687e+05   -2.529   0.0114 *  
Outcomewinner                6.932e-02  8.532e-03  7.602e+03    8.125 5.20e-16 ***
LogSadness                  -5.926e-02  4.544e-04  1.698e+05 -130.399  < 2e-16 ***
Time:PeriodBE                2.910e-01  3.099e-02  1.690e+05    9.389  < 2e-16 ***
Time:PeriodAR                2.010e-01  3.333e-02  1.692e+05    6.032 1.62e-09 ***
Time:Outcomewinner           1.923e-01  3.594e-02  1.597e+05    5.349 8.84e-08 ***
PeriodBE:Outcomewinner      -4.390e-02  7.791e-03  1.694e+05   -5.634 1.76e-08 ***
PeriodAR:Outcomewinner       9.525e-02  1.246e-02  1.692e+05    7.646 2.08e-14 ***
Time:PeriodBE:Outcomewinner -2.156e-01  3.617e-02  1.693e+05   -5.961 2.51e-09 ***
Time:PeriodAR:Outcomewinner -2.407e-01  3.864e-02  1.693e+05   -6.228 4.72e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LgSdns Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.695                                                                             
PeriodBE    -0.787  0.769                                                                      
PeriodAR    -0.468  0.472  0.514                                                               
Outcomewnnr -0.803  0.588  0.668  0.395                                                        
LogSadness   0.229 -0.007  0.000 -0.013  0.007                                                 
Time:PerdBE  0.693 -0.986 -0.722 -0.469 -0.587  0.009                                          
Time:PerdAR  0.647 -0.912 -0.713 -0.750 -0.548  0.011  0.908                                   
Tm:Otcmwnnr  0.593 -0.858 -0.659 -0.404 -0.697 -0.008  0.845  0.782                            
PrdBE:Otcmw  0.659 -0.646 -0.841 -0.432 -0.770 -0.009  0.607  0.600  0.765                     
PrdAR:Otcmw  0.405 -0.412 -0.448 -0.873 -0.476 -0.005  0.410  0.654  0.485  0.519              
Tm:PrdBE:Ot -0.590  0.844  0.618  0.402  0.694  0.008 -0.857 -0.777 -0.983 -0.708 -0.482       
Tm:PrdAR:Ot -0.555  0.787  0.615  0.647  0.652  0.005 -0.783 -0.862 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
# R2 for Mixed Models

  Conditional R2: 0.179
     Marginal R2: 0.108
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.080
  Unadjusted ICC: 0.072
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.067

Model Summary

pp(model);
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.24 -0.30, -0.18 <0.001
Period


    BE - MI 0.02 0.01, 0.04 <0.001
    AR - MI 0.01 0.00, 0.03 0.11
    AR - BE -0.01 -0.02, 0.00 0.2
Outcome


    winner - loser 0.08 0.07, 0.10 <0.001
LogSadness -0.06 -0.06, -0.06 <0.001
Time * Period


    Time * BE 0.29 0.23, 0.35 <0.001
    Time * AR 0.20 0.14, 0.27 <0.001
Time * Outcome


    Time * winner 0.19 0.12, 0.26 <0.001
Period * Outcome


    BE * winner -0.04 -0.06, -0.03 <0.001
    AR * winner 0.10 0.07, 0.12 <0.001
Time * Period * Outcome


    Time * BE * winner -0.22 -0.29, -0.14 <0.001
    Time * AR * winner -0.24 -0.32, -0.16 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time 0.02

Name.sd__Time 0.05

Residual.sd__Observation 0.25

1 CI = Confidence Interval

GGEffects: LogSadness: NULL

pp(model);
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
extra <- "1007"
terms <- c("LogSadness")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogSadness | Predicted |     95% CI
-----------------------------------
        -7 |      0.67 | 0.65, 0.69
        -6 |      0.61 | 0.60, 0.63
        -5 |      0.55 | 0.54, 0.57
        -4 |      0.49 | 0.48, 0.51
        -3 |      0.43 | 0.42, 0.45
        -2 |      0.38 | 0.36, 0.39
        -1 |      0.32 | 0.30, 0.33
         0 |      0.26 | 0.24, 0.27

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogSadness

Slope |       95% CI |      p
-----------------------------
-0.06 | -0.06, -0.06 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 12: Time x Period x Outcome + LogSurprise

Fit

model <- "fit12aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
   Data: df0
Control: control

REML criterion at convergence: 22600.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.2973 -0.5556  0.0008  0.5668  7.4738 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004566 0.06757       
          Time        0.003286 0.05732  -0.09
 Residual             0.065570 0.25607       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  3.944e-01  7.539e-03  1.230e+04  52.322  < 2e-16 ***
Time                        -2.817e-01  3.222e-02  1.608e+05  -8.743  < 2e-16 ***
PeriodBE                     5.820e-02  6.844e-03  1.693e+05   8.503  < 2e-16 ***
PeriodAR                    -5.126e-02  1.136e-02  1.686e+05  -4.512 6.43e-06 ***
Outcomewinner                7.197e-02  8.866e-03  7.906e+03   8.117 5.48e-16 ***
LogSurprise                 -1.924e-02  5.393e-04  1.696e+05 -35.673  < 2e-16 ***
Time:PeriodBE                3.455e-01  3.238e-02  1.690e+05  10.668  < 2e-16 ***
Time:PeriodAR                2.623e-01  3.482e-02  1.692e+05   7.533 4.99e-14 ***
Time:Outcomewinner           1.667e-01  3.757e-02  1.590e+05   4.437 9.15e-06 ***
PeriodBE:Outcomewinner      -5.144e-02  8.139e-03  1.694e+05  -6.320 2.63e-10 ***
PeriodAR:Outcomewinner       8.387e-02  1.301e-02  1.692e+05   6.445 1.16e-10 ***
Time:PeriodBE:Outcomewinner -1.892e-01  3.779e-02  1.692e+05  -5.008 5.52e-07 ***
Time:PeriodAR:Outcomewinner -2.147e-01  4.037e-02  1.693e+05  -5.318 1.05e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LgSrpr Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.698                                                                             
PeriodBE    -0.790  0.769                                                                      
PeriodAR    -0.464  0.471  0.514                                                               
Outcomewnnr -0.801  0.596  0.672  0.397                                                        
LogSurprise  0.231  0.010  0.002  0.012  0.018                                                 
Time:PerdBE  0.690 -0.985 -0.722 -0.469 -0.590 -0.015                                          
Time:PerdAR  0.646 -0.912 -0.713 -0.750 -0.551 -0.009  0.907                                   
Tm:Otcmwnnr  0.599 -0.858 -0.659 -0.404 -0.707 -0.007  0.845  0.782                            
PrdBE:Otcmw  0.662 -0.647 -0.841 -0.432 -0.774 -0.008  0.607  0.600  0.765                     
PrdAR:Otcmw  0.409 -0.411 -0.448 -0.873 -0.478  0.007  0.410  0.654  0.485  0.519              
Tm:PrdBE:Ot -0.593  0.844  0.619  0.402  0.698  0.008 -0.857 -0.778 -0.982 -0.709 -0.482       
Tm:PrdAR:Ot -0.559  0.786  0.615  0.647  0.655  0.001 -0.783 -0.862 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
# R2 for Mixed Models

  Conditional R2: 0.105
     Marginal R2: 0.027
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.080
  Unadjusted ICC: 0.078
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.064

Model Summary

pp(model);
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.28 -0.34, -0.22 <0.001
Period


    BE - MI 0.02 0.00, 0.03 0.007
    AR - MI -0.02 -0.04, 0.00 0.024
    AR - BE -0.04 -0.05, -0.02 <0.001
Outcome


    winner - loser 0.08 0.07, 0.09 <0.001
LogSurprise -0.02 -0.02, -0.02 <0.001
Time * Period


    Time * BE 0.35 0.28, 0.41 <0.001
    Time * AR 0.26 0.19, 0.33 <0.001
Time * Outcome


    Time * winner 0.17 0.09, 0.24 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.08 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.19 -0.26, -0.12 <0.001
    Time * AR * winner -0.21 -0.29, -0.14 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.09

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

GGEffects: LogSurprise: NULL

pp(model);
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
extra <- "1007"
terms <- c("LogSurprise")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogSurprise | Predicted |     95% CI
------------------------------------
         -7 |      0.55 | 0.53, 0.57
         -6 |      0.53 | 0.51, 0.55
         -5 |      0.51 | 0.49, 0.53
         -4 |      0.49 | 0.47, 0.51
         -3 |      0.47 | 0.45, 0.49
         -2 |      0.45 | 0.43, 0.47
         -1 |      0.43 | 0.41, 0.45
          0 |      0.41 | 0.40, 0.43

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogSurprise

Slope |       95% CI |      p
-----------------------------
-0.02 | -0.02, -0.02 | < .001
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 13: Time x Period x Outcome + LogNeutral

Fit

model <- "fit13aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
   Data: df0
Control: control

REML criterion at convergence: 23867

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.1797 -0.5638 -0.0079  0.5632  7.3807 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.004801 0.06929       
          Time        0.003338 0.05777  -0.07
 Residual             0.066045 0.25699       
Number of obs: 169997, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  4.555e-01  7.471e-03  1.098e+04  60.968  < 2e-16 ***
Time                        -2.706e-01  3.234e-02  1.606e+05  -8.368  < 2e-16 ***
PeriodBE                     5.844e-02  6.870e-03  1.693e+05   8.507  < 2e-16 ***
PeriodAR                    -4.621e-02  1.140e-02  1.686e+05  -4.052 5.08e-05 ***
Outcomewinner                7.759e-02  8.953e-03  7.532e+03   8.666  < 2e-16 ***
LogNeutral                  -4.683e-04  4.184e-04  1.667e+05  -1.119    0.263    
Time:PeriodBE                3.279e-01  3.250e-02  1.690e+05  10.087  < 2e-16 ***
Time:PeriodAR                2.510e-01  3.495e-02  1.692e+05   7.181 6.95e-13 ***
Time:Outcomewinner           1.574e-01  3.771e-02  1.588e+05   4.173 3.01e-05 ***
PeriodBE:Outcomewinner      -5.366e-02  8.170e-03  1.694e+05  -6.568 5.12e-11 ***
PeriodAR:Outcomewinner       8.679e-02  1.306e-02  1.692e+05   6.644 3.06e-11 ***
Time:PeriodBE:Outcomewinner -1.778e-01  3.793e-02  1.692e+05  -4.688 2.76e-06 ***
Time:PeriodAR:Outcomewinner -2.138e-01  4.052e-02  1.693e+05  -5.277 1.32e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn LgNtrl Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.707                                                                             
PeriodBE    -0.800  0.769                                                                      
PeriodAR    -0.473  0.471  0.514                                                               
Outcomewnnr -0.817  0.591  0.668  0.395                                                        
LogNeutral   0.138  0.012  0.000  0.003  0.008                                                 
Time:PerdBE  0.700 -0.985 -0.722 -0.469 -0.587 -0.018                                          
Time:PerdAR  0.655 -0.912 -0.713 -0.750 -0.547 -0.009  0.907                                   
Tm:Otcmwnnr  0.606 -0.858 -0.659 -0.404 -0.701 -0.007  0.845  0.782                            
PrdBE:Otcmw  0.672 -0.646 -0.841 -0.432 -0.770 -0.008  0.607  0.600  0.765                     
PrdAR:Otcmw  0.413 -0.411 -0.448 -0.873 -0.475  0.001  0.410  0.655  0.485  0.519              
Tm:PrdBE:Ot -0.601  0.844  0.619  0.402  0.694  0.008 -0.857 -0.778 -0.982 -0.708 -0.482       
Tm:PrdAR:Ot -0.565  0.786  0.615  0.647  0.651  0.004 -0.783 -0.863 -0.916 -0.713 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
# R2 for Mixed Models

  Conditional R2: 0.100
     Marginal R2: 0.019
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.083
  Unadjusted ICC: 0.081
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.067

Model Summary

pp(model);
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169997' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169997' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169997)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.27 -0.33, -0.21 <0.001
Period


    BE - MI 0.02 0.00, 0.03 0.007
    AR - MI -0.01 -0.03, 0.01 0.2
    AR - BE -0.03 -0.04, -0.01 <0.001
Outcome


    winner - loser 0.09 0.07, 0.10 <0.001
LogNeutral 0.00 0.00, 0.00 0.3
Time * Period


    Time * BE 0.33 0.26, 0.39 <0.001
    Time * AR 0.25 0.18, 0.32 <0.001
Time * Outcome


    Time * winner 0.16 0.08, 0.23 <0.001
Period * Outcome


    BE * winner -0.05 -0.07, -0.04 <0.001
    AR * winner 0.09 0.06, 0.11 <0.001
Time * Period * Outcome


    Time * BE * winner -0.18 -0.25, -0.10 <0.001
    Time * AR * winner -0.21 -0.29, -0.13 <0.001
Name.sd__(Intercept) 0.07

Name.cor__(Intercept).Time -0.07

Name.sd__Time 0.06

Residual.sd__Observation 0.26

1 CI = Confidence Interval

GGEffects: LogNeutral: NULL

pp(model);
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
extra <- "1007"
terms <- c("LogNeutral")
pred0 <- ggeffects::predict_response(get(model), terms=terms)
test0 <- ggeffects::test_predictions(get(model), terms=terms, test=NULL, p_adjust="fdr")

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- pred0 %>% plot(limit_range=FALSE,  show_data = TRUE, dot_alpha = 0.05,)
Data points may overlap. Use the `jitter` argument to add some amount of random variation to the location of data points and avoid overplotting.
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.png"))
ggsave(file = file, plot = gg88, width=8, height=6)
gg88

cat0(sep0)
===================================================================== 
pred0 %>% print(n=Inf)
# Predicted values of Agency

LogNeutral | Predicted |     95% CI
-----------------------------------
        -7 |      0.48 | 0.46, 0.50
        -6 |      0.48 | 0.46, 0.49
        -5 |      0.48 | 0.46, 0.49
        -4 |      0.48 | 0.46, 0.49
        -3 |      0.48 | 0.46, 0.49
        -2 |      0.47 | 0.46, 0.49
        -1 |      0.47 | 0.46, 0.49
         0 |      0.47 | 0.46, 0.49

Adjusted for:
*    Time = -0.07
*  Period =    MI
* Outcome = loser
*    Name = 0 (population-level)
cat0(sep0)
===================================================================== 
test0 %>% print(n=Inf)
# (Average) Linear trend for LogNeutral

Slope     |      95% CI |     p
-------------------------------
-4.68e-04 |  0.00, 0.00 | 0.263
pred0tab <- ggeffects::print_html(pred0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-pred0.html"))
pred0tab %>% tinytable::save_tt(file, overwrite=TRUE)

test0tab <- ggeffects::print_html(test0)
file = file.path(dir8, paste0(model,"-xtr-",extra,"-ggeffects-", paste(terms, collapse="-x-"),"-test0.html"))
test0tab %>% tinytable::save_tt(file, overwrite=TRUE)

Model 14: Time x Period x Outcome + EVERYTHING

Fit

model <- "fit14aPd"
suppressWarnings(rm(list = model))
assign(
  model,
  lmerTest::lmer(
    formula = Agency ~ (Time | Name) + Time * Period * Outcome +
      Concreteness + Readability + LogAnger + LogFear + LogJoy +
      LogDisgust + LogSadness + LogSurprise + LogNeutral,
    data = df0,
    REML = REML,
    control = control))

fbase <- file.path(dir8, model); write_model_info(fbase)

readr::write_rds(get(model), file = paste0(fbase, ".mdl.rds"))
pp(model); summary(get(model)) %>% print(correlation = TRUE)
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness +      Readability + LogAnger + LogFear + LogJoy + LogDisgust +      LogSadness + LogSurprise + LogNeutral
   Data: df0
Control: control

REML criterion at convergence: -15456.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-8.9590 -0.5844 -0.0295  0.5558  8.1903 

Random effects:
 Groups   Name        Variance Std.Dev. Corr 
 Name     (Intercept) 0.002871 0.05358       
          Time        0.001735 0.04165  -0.01
 Residual             0.052513 0.22916       
Number of obs: 169996, groups:  Name, 870

Fixed effects:
                              Estimate Std. Error         df  t value Pr(>|t|)    
(Intercept)                  1.814e-01  1.015e-02  6.101e+04   17.862  < 2e-16 ***
Time                        -2.048e-01  2.877e-02  1.632e+05   -7.118 1.10e-12 ***
PeriodBE                     2.218e-02  6.136e-03  1.693e+05    3.615 0.000300 ***
PeriodAR                    -3.505e-02  1.017e-02  1.682e+05   -3.448 0.000564 ***
Outcomewinner                1.175e-02  7.702e-03  1.046e+04    1.525 0.127291    
Concreteness                 2.822e-01  8.312e-03  1.692e+05   33.956  < 2e-16 ***
Readability                 -1.607e-01  3.768e-03  1.694e+05  -42.662  < 2e-16 ***
LogAnger                     2.930e-02  5.172e-04  1.699e+05   56.661  < 2e-16 ***
LogFear                      1.702e-02  4.102e-04  1.693e+05   41.491  < 2e-16 ***
LogJoy                       4.359e-02  4.037e-04  1.691e+05  107.972  < 2e-16 ***
LogDisgust                  -2.735e-02  5.872e-04  1.687e+05  -46.567  < 2e-16 ***
LogSadness                  -4.962e-02  4.438e-04  1.699e+05 -111.793  < 2e-16 ***
LogSurprise                 -5.321e-02  6.645e-04  1.699e+05  -80.080  < 2e-16 ***
LogNeutral                   3.529e-02  5.011e-04  1.694e+05   70.430  < 2e-16 ***
Time:PeriodBE                2.398e-01  2.897e-02  1.690e+05    8.280  < 2e-16 ***
Time:PeriodAR                1.850e-01  3.115e-02  1.692e+05    5.941 2.84e-09 ***
Time:Outcomewinner           2.269e-01  3.354e-02  1.626e+05    6.764 1.35e-11 ***
PeriodBE:Outcomewinner      -5.059e-03  7.287e-03  1.694e+05   -0.694 0.487496    
PeriodAR:Outcomewinner       1.082e-01  1.164e-02  1.690e+05    9.299  < 2e-16 ***
Time:PeriodBE:Outcomewinner -2.364e-01  3.380e-02  1.692e+05   -6.994 2.69e-12 ***
Time:PeriodAR:Outcomewinner -2.994e-01  3.612e-02  1.693e+05   -8.289  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of fixed effects could have been required in summary()

Correlation of Fixed Effects:
            (Intr) Time   PerdBE PerdAR Otcmwn Cncrtn Rdblty LgAngr LogFer LogJoy LgDsgs LgSdns LgSrpr LgNtrl Tm:PBE Tm:PAR Tm:Otc PrBE:O PrAR:O T:PBE:
Time        -0.466                                                                                                                                     
PeriodBE    -0.535  0.769                                                                                                                              
PeriodAR    -0.312  0.472  0.513                                                                                                                       
Outcomewnnr -0.521  0.612  0.691  0.409                                                                                                                
Concretenss -0.619  0.003  0.014 -0.012 -0.017                                                                                                         
Readability -0.075 -0.002 -0.027  0.012  0.035 -0.250                                                                                                  
LogAnger    -0.044 -0.003 -0.017 -0.012  0.014  0.049  0.027                                                                                           
LogFear      0.133  0.005 -0.050 -0.011 -0.030  0.008  0.109 -0.396                                                                                    
LogJoy       0.177  0.008 -0.030  0.012 -0.031 -0.045  0.080  0.077  0.196                                                                             
LogDisgust   0.289 -0.001  0.007 -0.012  0.004 -0.045  0.076 -0.398  0.246  0.182                                                                      
LogSadness   0.096 -0.006  0.000 -0.006 -0.003  0.044 -0.024 -0.044 -0.019  0.191 -0.074                                                               
LogSurprise  0.140 -0.001  0.009 -0.002  0.023  0.049 -0.100 -0.035  0.066 -0.322  0.177 -0.106                                                        
LogNeutral  -0.036  0.010 -0.010  0.002 -0.015 -0.039 -0.099  0.048  0.049  0.048 -0.330 -0.035 -0.570                                                 
Time:PerdBE  0.461 -0.987 -0.721 -0.470 -0.608 -0.001 -0.004  0.002 -0.012 -0.012  0.001  0.008 -0.001 -0.014                                          
Time:PerdAR  0.430 -0.914 -0.712 -0.750 -0.567  0.005 -0.002  0.006  0.000 -0.009  0.004  0.008  0.002 -0.008  0.908                                   
Tm:Otcmwnnr  0.402 -0.857 -0.661 -0.405 -0.726 -0.003 -0.008  0.006  0.006 -0.003 -0.005 -0.008  0.000  0.000  0.846  0.783                            
PrdBE:Otcmw  0.442 -0.648 -0.840 -0.432 -0.799  0.000  0.000  0.006  0.025  0.027 -0.010 -0.003 -0.013  0.007  0.607  0.600  0.767                     
PrdAR:Otcmw  0.275 -0.412 -0.449 -0.872 -0.493  0.000 -0.007  0.002  0.012  0.001 -0.002 -0.006  0.009  0.000  0.410  0.654  0.486  0.520              
Tm:PrdBE:Ot -0.398  0.845  0.619  0.402  0.720  0.003  0.009 -0.005 -0.004  0.006  0.004  0.009  0.001  0.000 -0.856 -0.778 -0.984 -0.709 -0.483       
Tm:PrdAR:Ot -0.377  0.788  0.615  0.646  0.676  0.003  0.009 -0.006 -0.013  0.000  0.005  0.006 -0.005 -0.001 -0.782 -0.862 -0.918 -0.714 -0.753  0.911
cat0(sep2); pp(model); performance::r2(get(model))
--------------------------------------------------------------------- 
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
# R2 for Mixed Models

  Conditional R2: 0.274
     Marginal R2: 0.227
cat0(sep2); pp(model); performance::icc(get(model))
--------------------------------------------------------------------- 
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
# Intraclass Correlation Coefficient

    Adjusted ICC: 0.062
  Unadjusted ICC: 0.048
cat0(sep2); pp(model); performance::icc(get(model), by_group = TRUE)
--------------------------------------------------------------------- 
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
Model contains random slopes. Cannot compute accurate ICCs by group factors.
# ICC by Group

Group |   ICC
-------------
Name  | 0.051

Model Summary

pp(model);
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
tbl0 <- gtsummary::tbl_regression(
  get(model),
  add_pairwise_contrasts = TRUE,
  exponentiate = FALSE,
  tidy_fun = broom.mixed::tidy,
)
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169996' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169996' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'pbkrtest.limit = 169996' (or larger)
[or, globally, 'set emm_options(pbkrtest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
To enable adjustments, add the argument 'lmerTest.limit = 169996' (or larger)
[or, globally, 'set emm_options(lmerTest.limit = 169996)' or larger];
but be warned that this may result in large computation time and memory use.
NOTE: Results may be misleading due to involvement in interactions
tbl0
Characteristic Beta 95% CI1 p-value
Time -0.20 -0.26, -0.15 <0.001
Period


    BE - MI 0.01 0.00, 0.02 0.033
    AR - MI 0.02 0.00, 0.03 0.038
    AR - BE 0.01 -0.01, 0.02 0.6
Outcome


    winner - loser 0.04 0.03, 0.05 <0.001
Concreteness 0.28 0.27, 0.30 <0.001
Readability -0.16 -0.17, -0.15 <0.001
LogAnger 0.03 0.03, 0.03 <0.001
LogFear 0.02 0.02, 0.02 <0.001
LogJoy 0.04 0.04, 0.04 <0.001
LogDisgust -0.03 -0.03, -0.03 <0.001
LogSadness -0.05 -0.05, -0.05 <0.001
LogSurprise -0.05 -0.05, -0.05 <0.001
LogNeutral 0.04 0.03, 0.04 <0.001
Time * Period


    Time * BE 0.24 0.18, 0.30 <0.001
    Time * AR 0.19 0.12, 0.25 <0.001
Time * Outcome


    Time * winner 0.23 0.16, 0.29 <0.001
Period * Outcome


    BE * winner -0.01 -0.02, 0.01 0.5
    AR * winner 0.11 0.09, 0.13 <0.001
Time * Period * Outcome


    Time * BE * winner -0.24 -0.30, -0.17 <0.001
    Time * AR * winner -0.30 -0.37, -0.23 <0.001
Name.sd__(Intercept) 0.05

Name.cor__(Intercept).Time -0.01

Name.sd__Time 0.04

Residual.sd__Observation 0.23

1 CI = Confidence Interval

Checkups

Skim

set.w(222)
df0 %>% skimr::skim()
Data summary
Name Piped data
Number of rows 169997
Number of columns 45
_______________________
Column type frequency:
factor 5
numeric 40
________________________
Group variables None

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
Name 0 1 FALSE 870 Bar: 361, Ela: 361, Llo: 361, Pra: 361
Party 0 1 FALSE 2 Dem: 99081, Rep: 70916
Outcome 0 1 FALSE 2 win: 115031, los: 54966
Period 0 1 FALSE 3 BE: 98660, AR: 47974, MI: 23363
Phase 0 1 FALSE 4 BE: 98660, AR: 47974, AE: 12011, BR: 11352

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Days 0 1 -12.25 102.89 -180.00 -99.00 -22.00 77.00 180.00 ▇▇▇▆▆
RetweetCount 0 1 545.28 3638.96 0.00 5.00 19.00 90.00 537702.00 ▇▁▁▁▁
ReplyCount 0 1 254.44 2115.06 0.00 2.00 9.00 40.00 164721.00 ▇▁▁▁▁
LikeCount 0 1 2754.23 22665.34 0.00 18.00 70.00 363.00 3432420.00 ▇▁▁▁▁
QuoteCount 0 1 61.86 486.57 0.00 0.00 2.00 9.00 39266.00 ▇▁▁▁▁
WordCount 0 1 88.11 88.67 0.00 36.00 63.00 113.00 2872.00 ▇▁▁▁▁
Concr 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Noun 1 1 0.20 0.07 0.00 0.17 0.20 0.24 1.00 ▇▇▁▁▁
Adj 1 1 0.07 0.05 0.00 0.05 0.07 0.09 1.00 ▇▁▁▁▁
VerbWOBH 1 1 0.13 0.05 0.00 0.11 0.13 0.16 1.00 ▇▁▁▁▁
VerbBaseWOBH 1 1 0.06 0.04 0.00 0.03 0.05 0.08 1.00 ▇▁▁▁▁
AgenBig2C 1 1 0.03 0.03 0.00 0.01 0.03 0.05 0.67 ▇▁▁▁▁
AgenBig2A 1 1 0.05 0.04 0.00 0.02 0.04 0.07 0.67 ▇▁▁▁▁
CommBig2A 1 1 0.07 0.05 0.00 0.03 0.06 0.09 1.00 ▇▁▁▁▁
AgenBig2B 1 1 0.01 0.02 0.00 0.00 0.00 0.02 1.00 ▇▁▁▁▁
CommBig2B 1 1 0.02 0.03 0.00 0.00 0.02 0.03 1.00 ▇▁▁▁▁
AgencyPosit 0 1 0.54 0.23 0.00 0.39 0.53 0.67 2.37 ▆▇▁▁▁
AgencyNegat 0 1 0.04 0.09 0.00 0.00 0.00 0.04 1.69 ▇▁▁▁▁
AgencyWhole 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
AgencyAbsol 0 1 0.58 0.22 0.00 0.44 0.57 0.71 2.37 ▅▇▁▁▁
Pron 1 1 0.10 0.05 0.00 0.07 0.10 0.13 1.00 ▇▁▁▁▁
Pron1StSing 1 1 0.02 0.03 0.00 0.00 0.01 0.03 0.50 ▇▁▁▁▁
Anger 0 1 0.11 0.16 0.00 0.02 0.05 0.15 0.99 ▇▁▁▁▁
Disgust 0 1 0.02 0.06 0.00 0.00 0.00 0.01 0.99 ▇▁▁▁▁
Fear 0 1 0.30 0.28 0.00 0.04 0.23 0.48 1.00 ▇▃▃▂▂
Joy 0 1 0.24 0.27 0.00 0.02 0.12 0.37 0.99 ▇▂▂▁▁
Neutral 0 1 0.19 0.22 0.00 0.02 0.10 0.30 0.97 ▇▂▁▁▁
Sadness 0 1 0.08 0.16 0.00 0.01 0.02 0.08 0.99 ▇▁▁▁▁
Surprise 0 1 0.06 0.09 0.00 0.01 0.03 0.07 0.98 ▇▁▁▁▁
Concreteness 1 1 0.84 0.07 0.00 0.81 0.85 0.88 1.00 ▁▁▁▂▇
Agency 0 1 0.50 0.27 -1.69 0.34 0.50 0.66 2.37 ▁▁▇▂▁
Readability 0 1 0.65 0.17 -3.24 0.55 0.65 0.75 1.77 ▁▁▁▇▂
Time 0 1 -0.07 0.57 -1.00 -0.55 -0.12 0.43 1.00 ▇▇▇▆▆
LogAnger 0 1 -3.04 1.42 -6.57 -4.11 -3.05 -1.89 0.00 ▂▆▇▇▃
LogDisgust 0 1 -5.37 1.33 -6.81 -6.28 -5.90 -4.88 -0.01 ▇▂▁▁▁
LogFear 0 1 -2.09 1.73 -6.72 -3.27 -1.45 -0.74 0.00 ▁▂▂▃▇
LogJoy 0 1 -2.49 1.76 -6.70 -3.95 -2.09 -0.99 -0.01 ▂▃▃▆▇
LogNeutral 0 1 -2.60 1.65 -6.73 -3.93 -2.26 -1.19 -0.03 ▂▅▅▇▇
LogSadness 0 1 -3.48 1.35 -6.45 -4.49 -3.75 -2.58 -0.01 ▂▇▆▃▂
LogSurprise 0 1 -3.48 1.23 -6.71 -4.33 -3.38 -2.60 -0.02 ▂▅▇▅▁

Variables influence / importance in fit05aPd

## TODO CHANGE TITLE
formula(fit05aPd)
Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
eff_size0 <- effectsize::eta_squared(fit05aPd)
eff_size2 <- eff_size0 %>%
  dplyr::mutate(Interpret = effectsize::interpret_eta_squared(Eta2_partial))

performance::print_html(eff_size2)
Effect Size for ANOVA
Parameter Eta2 (partial) 95% CI Interpret
Time 1.99e-03 [0.00, 1.00] very small
Period 6.03e-04 [0.00, 1.00] very small
Outcome 0.07 [0.05, 1.00] medium
Concreteness 3.68e-03 [0.00, 1.00] very small
Time:Period 1.57e-03 [0.00, 1.00] very small
Time:Outcome 7.96e-05 [0.00, 1.00] very small
Period:Outcome 1.08e-03 [0.00, 1.00] very small
Time:Period:Outcome 1.61e-04 [0.00, 1.00] very small

Variables influence / importance in fit14aPd

formula(fit14aPd)
Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral
eff_size0 <- effectsize::eta_squared(fit14aPd)
eff_size2 <- eff_size0 %>%
  dplyr::mutate(Interpret = effectsize::interpret_eta_squared(Eta2_partial))

performance::print_html(eff_size2)
Effect Size for ANOVA
Parameter Eta2 (partial) 95% CI Interpret
Time 7.40e-04 [0.00, 1.00] very small
Period 1.73e-04 [0.00, 1.00] very small
Outcome 0.02 [0.02, 1.00] small
Concreteness 6.77e-03 [0.01, 1.00] very small
Readability 0.01 [0.01, 1.00] small
LogAnger 0.02 [0.02, 1.00] small
LogFear 0.01 [0.01, 1.00] small
LogJoy 0.06 [0.06, 1.00] medium
LogDisgust 0.01 [0.01, 1.00] small
LogSadness 0.07 [0.05, 1.00] medium
LogSurprise 0.04 [0.03, 1.00] small
LogNeutral 0.03 [0.03, 1.00] small
Time:Period 1.09e-03 [0.00, 1.00] very small
Time:Outcome 2.84e-04 [0.00, 1.00] very small
Period:Outcome 7.60e-04 [0.00, 1.00] very small
Time:Period:Outcome 4.38e-04 [0.00, 1.00] very small

List models (for Model Hierarchy / Hierarchies)

temp <- lapply(ls(pattern="^fit\\d+"), pp)
fit00aPd: [df0] Agency ~ (1 | Name) + 1
fit01aPd: [df0] Agency ~ (Time | Name) + 1
fit02aPd: [df0] Agency ~ (Time | Name) + Time
fit03aPd: [df0] Agency ~ (Time | Name) + Time * Period
fit04aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome
fit05aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
fit06aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
fit07aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
fit08aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
fit09aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
fit10aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
fit11aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
fit12aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
fit13aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
fit14aPd: [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + 
    Readability + LogAnger + LogFear + LogJoy + LogDisgust + 
    LogSadness + LogSurprise + LogNeutral

Compare models using performance package with score

perf0 <- performance::compare_performance(
  fit00aPd, # [df0] Agency ~ (1 | Name) + 1
  fit01aPd, # [df0] Agency ~ (Time | Name) + 1
  fit02aPd, # [df0] Agency ~ (Time | Name) + Time
  fit03aPd, # [df0] Agency ~ (Time | Name) + Time * Period
  fit04aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome
  fit05aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
  fit06aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
  fit07aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
  fit08aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
  fit09aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
  fit10aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
  fit11aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
  fit12aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
  fit13aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
  fit14aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + Readability + LogAnger + LogFear + LogJoy + LogDisgust + LogSadness + LogSurprise + LogNeutral
  ## CAUTION: COMMA
  rank = TRUE, verbose = FALSE)
perf0 %>% performance::print_html()
Comparison of Model Performance Indices
Name Model R2 (cond.) R2 (marg.) ICC RMSE Sigma AIC weights AICc weights BIC weights Performance-Score
fit14aPd lmerModLmerTest 0.27 0.23 0.06 0.23 0.23 1.00 1.00 1.00 87.50%
fit11aPd lmerModLmerTest 0.18 0.11 0.08 0.24 0.25 0.00e+00 0.00e+00 0.00e+00 30.06%
fit09aPd lmerModLmerTest 0.14 0.07 0.07 0.25 0.25 0.00e+00 0.00e+00 0.00e+00 17.69%
fit03aPd lmerModLmerTest 0.11 4.32e-03 0.10 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 16.37%
fit02aPd lmerModLmerTest 0.10 4.62e-04 0.10 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 15.66%
fit08aPd lmerModLmerTest 0.11 0.03 0.09 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 14.24%
fit06aPd lmerModLmerTest 0.11 0.03 0.08 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 13.77%
fit07aPd lmerModLmerTest 0.11 0.02 0.09 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 13.64%
fit10aPd lmerModLmerTest 0.11 0.04 0.08 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 12.41%
fit12aPd lmerModLmerTest 0.11 0.03 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 11.83%
fit05aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 11.15%
fit04aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 11.12%
fit13aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 11.09%
fit01aPd lmerModLmerTest 0.09 0.00 0.09 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 9.85%
fit00aPd lmerModLmerTest 0.08 0.00 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.05%
NA
suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- perf0 %>% plot()
ggsave(
  file = file.path(dir8, "summary-combined-models.perf.compare-02-score.png"),
  plot = gg88,
  width=8,
  height=6)
gg88  ## See below for the plot

Compare less models

perf0 <- performance::compare_performance(
  ## fit00aPd, # [df0] Agency ~ (1 | Name) + 1
  ## fit01aPd, # [df0] Agency ~ (Time | Name) + 1
  ## fit02aPd, # [df0] Agency ~ (Time | Name) + Time
  fit03aPd, # [df0] Agency ~ (Time | Name) + Time * Period
  fit04aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome
  fit05aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
  fit06aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
  fit07aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
  ## fit08aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
  fit09aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
  ## fit10aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
  ## fit11aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
  ## fit12aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
  ## fit13aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
  fit14aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + Readability + LogAnger + LogFear + LogJoy + LogDisgust + LogSadness + LogSurprise + LogNeutral
  ## CAUTION: COMMA
  rank = TRUE, verbose = FALSE)
perf0 %>% performance::print_html()
Comparison of Model Performance Indices
Name Model R2 (cond.) R2 (marg.) ICC RMSE Sigma AIC weights AICc weights BIC weights Performance-Score
fit14aPd lmerModLmerTest 0.27 0.23 0.06 0.23 0.23 1.00 1.00 1.00 87.50%
fit09aPd lmerModLmerTest 0.14 0.07 0.07 0.25 0.25 0.00e+00 0.00e+00 0.00e+00 14.91%
fit03aPd lmerModLmerTest 0.11 4.32e-03 0.10 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 12.88%
fit06aPd lmerModLmerTest 0.11 0.03 0.08 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 10.45%
fit07aPd lmerModLmerTest 0.11 0.02 0.09 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 10.21%
fit05aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.65%
fit04aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.58%
NA
suppressWarnings(rm(list = ls(pattern = "^gg44")))
gg44 <- perf0 %>% plot()
ggsave(
  file = file.path(dir8, "summary-combined-models.perf.compare-03-score.png"),
  plot = gg44,
  width=8,
  height=6)
gg44  ## See below for the plot

Comment

Add interpretation of the difference between best fit to data and best predictive power and overfitting (aspecially in the context of the last model).

Question: maybe Magda has some info about the ICC in LMER.

gg44

Performance Table Sorted by R2_conditional

perf0 %>% dplyr::arrange(R2_conditional) %>% performance::print_html()
Comparison of Model Performance Indices
Name Model R2 (cond.) R2 (marg.) ICC RMSE Sigma AIC weights AICc weights BIC weights Performance-Score
fit04aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.58%
fit05aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.65%
fit03aPd lmerModLmerTest 0.11 4.32e-03 0.10 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 12.88%
fit07aPd lmerModLmerTest 0.11 0.02 0.09 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 10.21%
fit06aPd lmerModLmerTest 0.11 0.03 0.08 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 10.45%
fit09aPd lmerModLmerTest 0.14 0.07 0.07 0.25 0.25 0.00e+00 0.00e+00 0.00e+00 14.91%
fit14aPd lmerModLmerTest 0.27 0.23 0.06 0.23 0.23 1.00 1.00 1.00 87.50%
NA

Performance Table Sorted by R2_marginal

perf0 %>% dplyr::arrange(R2_marginal) %>% performance::print_html()
Comparison of Model Performance Indices
Name Model R2 (cond.) R2 (marg.) ICC RMSE Sigma AIC weights AICc weights BIC weights Performance-Score
fit03aPd lmerModLmerTest 0.11 4.32e-03 0.10 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 12.88%
fit04aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.58%
fit05aPd lmerModLmerTest 0.10 0.02 0.08 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 7.65%
fit07aPd lmerModLmerTest 0.11 0.02 0.09 0.26 0.26 0.00e+00 0.00e+00 0.00e+00 10.21%
fit06aPd lmerModLmerTest 0.11 0.03 0.08 0.25 0.26 0.00e+00 0.00e+00 0.00e+00 10.45%
fit09aPd lmerModLmerTest 0.14 0.07 0.07 0.25 0.25 0.00e+00 0.00e+00 0.00e+00 14.91%
fit14aPd lmerModLmerTest 0.27 0.23 0.06 0.23 0.23 1.00 1.00 1.00 87.50%
NA

Interpret R2

model <- "fit00aPd" # [df0] Agency ~ (1 | Name) + 1
model <- "fit01aPd" # [df0] Agency ~ (Time | Name) + 1
model <- "fit02aPd" # [df0] Agency ~ (Time | Name) + Time
model <- "fit03aPd" # [df0] Agency ~ (Time | Name) + Time * Period
model <- "fit04aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome
model <- "fit05aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
model <- "fit06aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
model <- "fit07aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
model <- "fit08aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
model <- "fit09aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
model <- "fit10aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
model <- "fit11aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
model <- "fit12aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
model <- "fit13aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
model <- "fit14aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + Readability + LogAnger + LogFear + LogJoy + LogDisgust + LogSadness + LogSurprise + LogNeutral

model <- "fit05aPd" # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness

cat0(effectsize::interpret_r2(performance::r2(get(model))$R2_conditional, rules="cohen1988"))
weak 
cat0(effectsize::interpret_r2(performance::r2(get(model))$R2_marginal, rules="cohen1988"))
weak 

Plot models: Part 1: Basic Models

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_models(
  ## CAUTION the null model can not be used here 
  ## Thus to keep the numbers consistent I have 
  ## used model 02 as an input twice
  fit02aPd, # [df0] Agency ~ (Time | Name) + Time 
  fit02aPd, # [df0] Agency ~ (Time | Name) + Time
  fit03aPd, # [df0] Agency ~ (Time | Name) + Time * Period
  fit04aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome
  fit05aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
  spacing=1, dot.size=1
)

ggsave(
  file = "all-models-part-01.png",
  plot = gg88,
  width=5,
  height=8)

gg88

Plot models: Part 2: Auxiliary Models

suppressWarnings(rm(list = ls(pattern = "^gg88")))
gg88 <- sjPlot::plot_models(
  fit05aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
  fit06aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
  fit07aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
  fit08aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
  fit09aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
  fit10aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
  fit11aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
  fit12aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
  fit13aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
  fit14aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + Readability + LogAnger + LogFear + LogJoy + LogDisgust + LogSadness + LogSurprise + LogNeutral
  spacing=1, dot.size=0.5
)
Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Set1 is 9
Returning the palette you asked for with that many colors
ggsave(
  file = "all-models-part-02.png",
  plot = gg88,
  width=5,
  height=8)

gg88

Tab Models

The above `plot_models` seems to be a lot more illustrative

# , eval = TRUE, results='hide'
library(sjPlot)
library(sjmisc)

Attaching package: 'sjmisc'
The following object is masked from 'package:purrr':

    is_empty
The following object is masked from 'package:tidyr':

    replace_na
The following object is masked from 'package:tibble':

    add_case
library(sjlabelled)

Attaching package: 'sjlabelled'
The following object is masked from 'package:forcats':

    as_factor
The following object is masked from 'package:dplyr':

    as_label
The following object is masked from 'package:ggplot2':

    as_label
tab0 <- sjPlot::tab_model(
  fit00aPd, # [df0] Agency ~ (1 | Name) + 1
  fit01aPd, # [df0] Agency ~ (Time | Name) + 1
  fit02aPd, # [df0] Agency ~ (Time | Name) + Time
  fit03aPd, # [df0] Agency ~ (Time | Name) + Time * Period
  fit04aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome
  fit05aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness
  fit06aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Readability
  fit07aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogAnger
  fit08aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogFear
  fit09aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogJoy
  fit10aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogDisgust
  fit11aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSadness
  fit12aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogSurprise
  fit13aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + LogNeutral
  fit14aPd, # [df0] Agency ~ (Time | Name) + Time * Period * Outcome + Concreteness + Readability + LogAnger + LogFear + LogJoy + LogDisgust + LogSadness + LogSurprise + LogNeutral
    show.reflvl = TRUE,
    show.intercept = TRUE,
    p.style = "numeric_stars",
    file = "all-models-SEE-PNG-images-for-a-better-overview.html"
    )
tab0
  Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency Agency
Predictors Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p Estimates CI p
(Intercept) 0.50 *** 0.49 – 0.50 <0.001 0.50 *** 0.49 – 0.51 <0.001 0.50 *** 0.49 – 0.50 <0.001 0.51 *** 0.50 – 0.51 <0.001 0.46 *** 0.44 – 0.47 <0.001 0.27 *** 0.25 – 0.29 <0.001 0.58 *** 0.57 – 0.60 <0.001 0.50 *** 0.48 – 0.51 <0.001 0.50 *** 0.49 – 0.52 <0.001 0.55 *** 0.53 – 0.56 <0.001 0.32 *** 0.31 – 0.34 <0.001 0.24 *** 0.23 – 0.25 <0.001 0.39 *** 0.38 – 0.41 <0.001 0.46 *** 0.44 – 0.47 <0.001 0.18 *** 0.16 – 0.20 <0.001
Concreteness 0.22 *** 0.21 – 0.24 <0.001 0.28 *** 0.27 – 0.30 <0.001
LogAnger 0.01 *** 0.01 – 0.01 <0.001 0.03 *** 0.03 – 0.03 <0.001
LogDisgust -0.03 *** -0.03 – -0.02 <0.001 -0.03 *** -0.03 – -0.03 <0.001
LogFear 0.02 *** 0.02 – 0.02 <0.001 0.02 *** 0.02 – 0.02 <0.001
LogJoy 0.03 *** 0.03 – 0.04 <0.001 0.04 *** 0.04 – 0.04 <0.001
LogNeutral -0.00 -0.00 – 0.00 0.263 0.04 *** 0.03 – 0.04 <0.001
LogSadness -0.06 *** -0.06 – -0.06 <0.001 -0.05 *** -0.05 – -0.05 <0.001
LogSurprise -0.02 *** -0.02 – -0.02 <0.001 -0.05 *** -0.05 – -0.05 <0.001
MI Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference
BE 0.02 *** 0.02 – 0.03 <0.001 0.06 *** 0.04 – 0.07 <0.001 0.06 *** 0.05 – 0.07 <0.001 0.06 *** 0.05 – 0.08 <0.001 0.05 *** 0.04 – 0.07 <0.001 0.04 *** 0.03 – 0.06 <0.001 0.05 *** 0.04 – 0.06 <0.001 0.06 *** 0.04 – 0.07 <0.001 0.06 *** 0.05 – 0.07 <0.001 0.06 *** 0.04 – 0.07 <0.001 0.06 *** 0.04 – 0.07 <0.001 0.02 *** 0.01 – 0.03 <0.001
AR 0.02 *** 0.01 – 0.03 <0.001 -0.05 *** -0.07 – -0.02 <0.001 -0.05 *** -0.07 – -0.03 <0.001 -0.05 *** -0.08 – -0.03 <0.001 -0.06 *** -0.08 – -0.03 <0.001 -0.06 *** -0.08 – -0.03 <0.001 -0.02 -0.04 – 0.00 0.093 -0.03 ** -0.06 – -0.01 0.004 -0.03 * -0.05 – -0.01 0.011 -0.05 *** -0.07 – -0.03 <0.001 -0.05 *** -0.07 – -0.02 <0.001 -0.04 *** -0.05 – -0.02 0.001
PeriodAR:Outcomewinner 0.09 *** 0.06 – 0.11 <0.001 0.09 *** 0.06 – 0.11 <0.001 0.09 *** 0.07 – 0.12 <0.001 0.09 *** 0.06 – 0.11 <0.001 0.09 *** 0.07 – 0.12 <0.001 0.09 *** 0.06 – 0.11 <0.001 0.09 *** 0.06 – 0.11 <0.001 0.10 *** 0.07 – 0.12 <0.001 0.08 *** 0.06 – 0.11 <0.001 0.09 *** 0.06 – 0.11 <0.001 0.11 *** 0.09 – 0.13 <0.001
loser Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference
PeriodBE:Outcomewinner -0.05 *** -0.07 – -0.04 <0.001 -0.05 *** -0.07 – -0.04 <0.001 -0.05 *** -0.07 – -0.04 <0.001 -0.05 *** -0.07 – -0.04 <0.001 -0.05 *** -0.06 – -0.03 <0.001 -0.04 *** -0.05 – -0.02 <0.001 -0.05 *** -0.06 – -0.03 <0.001 -0.04 *** -0.06 – -0.03 <0.001 -0.05 *** -0.07 – -0.04 <0.001 -0.05 *** -0.07 – -0.04 <0.001 -0.01 -0.02 – 0.01 0.487
winner 0.08 *** 0.06 – 0.10 <0.001 0.08 *** 0.06 – 0.09 <0.001 0.06 *** 0.05 – 0.08 <0.001 0.08 *** 0.06 – 0.10 <0.001 0.07 *** 0.05 – 0.09 <0.001 0.06 *** 0.04 – 0.08 <0.001 0.07 *** 0.05 – 0.09 <0.001 0.07 *** 0.05 – 0.09 <0.001 0.07 *** 0.05 – 0.09 <0.001 0.08 *** 0.06 – 0.10 <0.001 0.01 -0.00 – 0.03 0.127
Readability -0.18 *** -0.19 – -0.17 <0.001 -0.16 *** -0.17 – -0.15 <0.001
Time -0.01 *** -0.02 – -0.01 <0.001 -0.15 *** -0.18 – -0.12 <0.001 -0.27 *** -0.33 – -0.21 <0.001 -0.27 *** -0.33 – -0.20 <0.001 -0.27 *** -0.34 – -0.21 <0.001 -0.28 *** -0.34 – -0.21 <0.001 -0.27 *** -0.34 – -0.21 <0.001 -0.23 *** -0.30 – -0.17 <0.001 -0.27 *** -0.33 – -0.20 <0.001 -0.24 *** -0.30 – -0.18 <0.001 -0.28 *** -0.34 – -0.22 <0.001 -0.27 *** -0.33 – -0.21 <0.001 -0.20 *** -0.26 – -0.15 <0.001
Time:Outcomewinner 0.16 *** 0.08 – 0.23 <0.001 0.15 *** 0.08 – 0.22 <0.001 0.18 *** 0.10 – 0.25 <0.001 0.17 *** 0.09 – 0.24 <0.001 0.18 *** 0.10 – 0.25 <0.001 0.14 *** 0.07 – 0.21 <0.001 0.16 *** 0.09 – 0.24 <0.001 0.19 *** 0.12 – 0.26 <0.001 0.17 *** 0.09 – 0.24 <0.001 0.16 *** 0.08 – 0.23 <0.001 0.23 *** 0.16 – 0.29 <0.001
Time:PeriodAR 0.08 *** 0.05 – 0.12 <0.001 0.25 *** 0.18 – 0.32 <0.001 0.25 *** 0.18 – 0.32 <0.001 0.26 *** 0.19 – 0.33 <0.001 0.26 *** 0.19 – 0.33 <0.001 0.26 *** 0.19 – 0.33 <0.001 0.20 *** 0.13 – 0.27 <0.001 0.24 *** 0.17 – 0.30 <0.001 0.20 *** 0.14 – 0.27 <0.001 0.26 *** 0.19 – 0.33 <0.001 0.25 *** 0.18 – 0.32 <0.001 0.19 *** 0.12 – 0.25 <0.001
Time:PeriodAR:Outcomewinner -0.21 *** -0.29 – -0.13 <0.001 -0.21 *** -0.29 – -0.13 <0.001 -0.24 *** -0.32 – -0.16 <0.001 -0.22 *** -0.30 – -0.15 <0.001 -0.24 *** -0.32 – -0.17 <0.001 -0.21 *** -0.28 – -0.13 <0.001 -0.22 *** -0.30 – -0.14 <0.001 -0.24 *** -0.32 – -0.16 <0.001 -0.21 *** -0.29 – -0.14 <0.001 -0.21 *** -0.29 – -0.13 <0.001 -0.30 *** -0.37 – -0.23 <0.001
Time:PeriodBE 0.19 *** 0.16 – 0.23 <0.001 0.33 *** 0.26 – 0.39 <0.001 0.32 *** 0.26 – 0.39 <0.001 0.34 *** 0.28 – 0.40 <0.001 0.33 *** 0.27 – 0.39 <0.001 0.32 *** 0.26 – 0.39 <0.001 0.28 *** 0.22 – 0.34 <0.001 0.32 *** 0.26 – 0.39 <0.001 0.29 *** 0.23 – 0.35 <0.001 0.35 *** 0.28 – 0.41 <0.001 0.33 *** 0.26 – 0.39 <0.001 0.24 *** 0.18 – 0.30 <0.001
Time:PeriodBE:Outcomewinner -0.18 *** -0.25 – -0.10 <0.001 -0.17 *** -0.25 – -0.10 <0.001 -0.20 *** -0.27 – -0.13 <0.001 -0.18 *** -0.26 – -0.11 <0.001 -0.19 *** -0.27 – -0.12 <0.001 -0.15 *** -0.22 – -0.08 <0.001 -0.18 *** -0.26 – -0.11 <0.001 -0.22 *** -0.29 – -0.14 <0.001 -0.19 *** -0.26 – -0.12 <0.001 -0.18 *** -0.25 – -0.10 <0.001 -0.24 *** -0.30 – -0.17 <0.001
Random Effects
σ2 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.06 0.07 0.06 0.07 0.07 0.05
τ00 0.01 Name 0.01 Name 0.01 Name 0.01 Name 0.00 Name 0.00 Name 0.00 Name 0.01 Name 0.00 Name 0.00 Name 0.00 Name 0.00 Name 0.00 Name 0.00 Name 0.00 Name
τ11   0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time 0.00 Name.Time
ρ01   0.18 Name 0.18 Name 0.18 Name -0.07 Name -0.06 Name -0.09 Name -0.07 Name -0.09 Name -0.01 Name -0.05 Name 0.02 Name -0.09 Name -0.07 Name -0.01 Name
ICC 0.08 0.09 0.10 0.10 0.08 0.08 0.08 0.09 0.09 0.07 0.08 0.08 0.08 0.08 0.06
N 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name 870 Name
Observations 169997 169997 169997 169997 169997 169996 169997 169997 169997 169997 169997 169997 169997 169997 169996
Marginal R2 / Conditional R2 0.000 / 0.084 0.000 / 0.086 0.000 / 0.102 0.004 / 0.105 0.019 / 0.100 0.022 / 0.101 0.032 / 0.111 0.022 / 0.108 0.029 / 0.111 0.069 / 0.136 0.035 / 0.110 0.108 / 0.179 0.027 / 0.105 0.019 / 0.100 0.227 / 0.274
* p<0.05   ** p<0.01   *** p<0.001
## knitr::html
## papaja::
## rmarkdown::render
## rmarkdown::render(tab0$knitr)
## tab0$knitr